From b098ac1fe7f7b27fa550f2f55009aa5eb0b75143 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Fri, 5 Dec 2025 15:06:34 +0100 Subject: [PATCH 1/4] Generate Transfers models --- .../AULocalAccountIdentification.java | 73 +++ .../AdditionalBankIdentification.java | 65 +++ .../com/adyen/model/transfers/Address.java | 97 ++++ .../com/adyen/model/transfers/Airline.java | 65 +++ .../com/adyen/model/transfers/Amount.java | 95 +++- .../model/transfers/AmountAdjustment.java | 73 +++ .../transfers/ApproveTransfersRequest.java | 57 +++ .../BRLocalAccountIdentification.java | 89 ++++ .../model/transfers/BalanceMutation.java | 81 ++++ .../adyen/model/transfers/BankAccountV3.java | 126 ++++- .../model/transfers/BankCategoryData.java | 135 ++++-- .../CALocalAccountIdentification.java | 89 ++++ .../CZLocalAccountIdentification.java | 73 +++ .../transfers/CancelTransfersRequest.java | 57 +++ .../adyen/model/transfers/CapitalBalance.java | 81 ++++ .../adyen/model/transfers/CapitalGrant.java | 121 +++++ .../model/transfers/CapitalGrantInfo.java | 73 +++ .../adyen/model/transfers/CapitalGrants.java | 57 +++ .../java/com/adyen/model/transfers/Card.java | 65 +++ .../model/transfers/CardIdentification.java | 105 ++++ .../transfers/ConfirmationTrackingData.java | 65 +++ .../adyen/model/transfers/Counterparty.java | 73 +++ .../model/transfers/CounterpartyInfoV3.java | 81 ++++ .../adyen/model/transfers/CounterpartyV3.java | 89 ++++ .../DKLocalAccountIdentification.java | 73 +++ .../transfers/DirectDebitInformation.java | 81 ++++ .../transfers/EstimationTrackingData.java | 65 +++ .../adyen/model/transfers/ExecutionDate.java | 65 +++ .../adyen/model/transfers/ExternalReason.java | 73 +++ .../java/com/adyen/model/transfers/Fee.java | 57 +++ .../transfers/FindTransfersResponse.java | 65 +++ .../model/transfers/FundingInstrument.java | 385 +++++++++++++++ .../HKLocalAccountIdentification.java | 73 +++ .../HULocalAccountIdentification.java | 65 +++ .../transfers/IbanAccountIdentification.java | 65 +++ .../model/transfers/InternalCategoryData.java | 74 +++ .../transfers/InternalReviewTrackingData.java | 73 +++ .../adyen/model/transfers/InvalidField.java | 73 +++ .../com/adyen/model/transfers/IssuedCard.java | 121 +++++ .../transfers/IssuingTransactionData.java | 65 +++ .../java/com/adyen/model/transfers/Leg.java | 97 ++++ .../java/com/adyen/model/transfers/Link.java | 57 +++ .../java/com/adyen/model/transfers/Links.java | 65 +++ .../com/adyen/model/transfers/Lodging.java | 65 +++ .../adyen/model/transfers/MerchantData.java | 89 ++++ .../model/transfers/MerchantPurchaseData.java | 73 +++ .../adyen/model/transfers/Modification.java | 89 ++++ .../NOLocalAccountIdentification.java | 65 +++ .../NZLocalAccountIdentification.java | 65 +++ .../adyen/model/transfers/NameLocation.java | 97 ++++ .../NumberAndBicAccountIdentification.java | 82 ++++ .../PLLocalAccountIdentification.java | 65 +++ .../model/transfers/PartyIdentification.java | 121 +++++ .../model/transfers/PaymentInstrument.java | 81 ++++ .../model/transfers/PlatformPayment.java | 280 +++++++---- .../transfers/RelayedAuthorisationData.java | 65 +++ .../com/adyen/model/transfers/Repayment.java | 73 +++ .../adyen/model/transfers/RepaymentTerm.java | 65 +++ .../model/transfers/ResourceReference.java | 73 +++ .../model/transfers/RestServiceError.java | 121 +++++ .../transfers/ReturnTransferRequest.java | 65 +++ .../transfers/ReturnTransferResponse.java | 81 ++++ .../adyen/model/transfers/RoutingDetails.java | 151 ++++-- .../SELocalAccountIdentification.java | 73 +++ .../SGLocalAccountIdentification.java | 73 +++ .../adyen/model/transfers/ServiceError.java | 89 ++++ .../adyen/model/transfers/ThreeDSecure.java | 57 +++ .../model/transfers/ThresholdRepayment.java | 57 +++ .../adyen/model/transfers/Transaction.java | 153 ++++++ .../transfers/TransactionEventViolation.java | 73 +++ .../transfers/TransactionRuleReference.java | 89 ++++ .../transfers/TransactionRuleSource.java | 65 +++ .../transfers/TransactionRulesResult.java | 81 ++++ .../transfers/TransactionSearchResponse.java | 65 +++ .../com/adyen/model/transfers/Transfer.java | 382 ++++++++++++--- .../adyen/model/transfers/TransferData.java | 454 +++++++++++++++--- .../adyen/model/transfers/TransferEvent.java | 195 ++++++++ .../adyen/model/transfers/TransferInfo.java | 395 ++++++++++----- .../TransferNotificationCounterParty.java | 89 ++++ .../TransferNotificationMerchantData.java | 105 ++++ .../TransferNotificationValidationFact.java | 65 +++ .../transfers/TransferRequestReview.java | 65 +++ .../adyen/model/transfers/TransferReview.java | 65 +++ .../TransferServiceRestServiceError.java | 129 +++++ .../adyen/model/transfers/TransferView.java | 73 +++ .../UKLocalAccountIdentification.java | 73 +++ .../USLocalAccountIdentification.java | 81 ++++ .../UltimatePartyIdentification.java | 179 ++++++- 88 files changed, 8320 insertions(+), 448 deletions(-) create mode 100644 src/main/java/com/adyen/model/transfers/FundingInstrument.java diff --git a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java index 7783e05a6..1366538da 100644 --- a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class AULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; private String bsbCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + /** **auLocal** */ public enum TypeEnum { AULOCAL(String.valueOf("auLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AULocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AULocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java index e04fa046c..bc049c895 100644 --- a/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class AdditionalBankIdentification { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + /** * The type of additional bank identification, depending on the country. Possible values: * * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) @@ -89,6 +94,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalBankIdentification() {} /** @@ -99,6 +113,7 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -122,6 +137,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -150,6 +166,7 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -209,6 +226,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalBankIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalBankIdentification object is equal to o. */ @@ -250,6 +288,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Address.java b/src/main/java/com/adyen/model/transfers/Address.java index 91636b973..4e954423d 100644 --- a/src/main/java/com/adyen/model/transfers/Address.java +++ b/src/main/java/com/adyen/model/transfers/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Address { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Address() {} /** @@ -57,6 +83,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -95,6 +123,7 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -120,6 +149,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setCountry(String country) { */ public Address line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -175,6 +207,7 @@ public void setLine1(String line1) { */ public Address line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -204,6 +237,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -218,6 +252,7 @@ public void setLine2(String line2) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -249,6 +284,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -261,6 +297,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -288,6 +325,27 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Address includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Address object is equal to o. */ @@ -337,6 +395,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Address given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Airline.java b/src/main/java/com/adyen/model/transfers/Airline.java index 6c8b03983..f984a8439 100644 --- a/src/main/java/com/adyen/model/transfers/Airline.java +++ b/src/main/java/com/adyen/model/transfers/Airline.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,9 +27,21 @@ public class Airline { public static final String JSON_PROPERTY_LEGS = "legs"; private List legs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegs = false; + public static final String JSON_PROPERTY_TICKET_NUMBER = "ticketNumber"; private String ticketNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTicketNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Airline() {} /** @@ -38,6 +52,7 @@ public Airline() {} */ public Airline legs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set return this; } @@ -69,6 +84,7 @@ public List getLegs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setLegs(List legs) { */ public Airline ticketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set return this; } @@ -102,6 +119,27 @@ public String getTicketNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTicketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Airline includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Airline object is equal to o. */ @@ -143,6 +181,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLegs) { + addIfNull(nulls, JSON_PROPERTY_LEGS, this.legs); + } + if (isSetTicketNumber) { + addIfNull(nulls, JSON_PROPERTY_TICKET_NUMBER, this.ticketNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Airline given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Amount.java b/src/main/java/com/adyen/model/transfers/Amount.java index 530fab926..b291d2f90 100644 --- a/src/main/java/com/adyen/model/transfers/Amount.java +++ b/src/main/java/com/adyen/model/transfers/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,30 +25,47 @@ public class Amount { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Long value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * @return the current {@code Amount} instance, allowing for method chaining */ public Amount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @return currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,35 +75,39 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * @return the current {@code Amount} instance, allowing for method chaining */ public Amount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @return value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @@ -94,16 +117,37 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Amount object is equal to o. */ @@ -145,6 +189,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Amount given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/AmountAdjustment.java b/src/main/java/com/adyen/model/transfers/AmountAdjustment.java index 03b2df268..d02e0742a 100644 --- a/src/main/java/com/adyen/model/transfers/AmountAdjustment.java +++ b/src/main/java/com/adyen/model/transfers/AmountAdjustment.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class AmountAdjustment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The type of markup that is applied to an authorised payment. Possible values: **exchange**, * **forexMarkup**, **authHoldReserve**, **atmMarkup**. @@ -82,9 +87,21 @@ public static AmountAdjustmentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE = "amountAdjustmentType"; private AmountAdjustmentTypeEnum amountAdjustmentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustmentType = false; + public static final String JSON_PROPERTY_BASEPOINTS = "basepoints"; private Integer basepoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasepoints = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AmountAdjustment() {} /** @@ -95,6 +112,7 @@ public AmountAdjustment() {} */ public AmountAdjustment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -118,6 +136,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -130,6 +149,7 @@ public void setAmount(Amount amount) { */ public AmountAdjustment amountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set return this; } @@ -157,6 +177,7 @@ public AmountAdjustmentTypeEnum getAmountAdjustmentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set } /** @@ -167,6 +188,7 @@ public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentTyp */ public AmountAdjustment basepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set return this; } @@ -190,6 +212,27 @@ public Integer getBasepoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountAdjustment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AmountAdjustment object is equal to o. */ @@ -235,6 +278,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustmentType) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE, this.amountAdjustmentType); + } + if (isSetBasepoints) { + addIfNull(nulls, JSON_PROPERTY_BASEPOINTS, this.basepoints); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AmountAdjustment given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java b/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java index a8c71d092..e4594e196 100644 --- a/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java +++ b/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class ApproveTransfersRequest { public static final String JSON_PROPERTY_TRANSFER_IDS = "transferIds"; private List transferIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApproveTransfersRequest() {} /** @@ -35,6 +46,7 @@ public ApproveTransfersRequest() {} */ public ApproveTransfersRequest transferIds(List transferIds) { this.transferIds = transferIds; + isSetTransferIds = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getTransferIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferIds(List transferIds) { this.transferIds = transferIds; + isSetTransferIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApproveTransfersRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApproveTransfersRequest object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransferIds) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_IDS, this.transferIds); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApproveTransfersRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java index 728d4dff6..144cb0e4d 100644 --- a/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class BRLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_ISPB = "ispb"; private String ispb; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIspb = false; + /** **brLocal** */ public enum TypeEnum { BRLOCAL(String.valueOf("brLocal")); @@ -84,6 +98,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BRLocalAccountIdentification() {} /** @@ -94,6 +117,7 @@ public BRLocalAccountIdentification() {} */ public BRLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAccountNumber(String accountNumber) { */ public BRLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setBankCode(String bankCode) { */ public BRLocalAccountIdentification branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -193,6 +222,7 @@ public void setBranchNumber(String branchNumber) { */ public BRLocalAccountIdentification ispb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set return this; } @@ -216,6 +246,7 @@ public String getIspb() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIspb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set } /** @@ -226,6 +257,7 @@ public void setIspb(String ispb) { */ public BRLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -249,6 +281,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BRLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BRLocalAccountIdentification object is equal to o. */ @@ -296,6 +349,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetIspb) { + addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BRLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/BalanceMutation.java b/src/main/java/com/adyen/model/transfers/BalanceMutation.java index 2514bdce2..b91c3eb29 100644 --- a/src/main/java/com/adyen/model/transfers/BalanceMutation.java +++ b/src/main/java/com/adyen/model/transfers/BalanceMutation.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class BalanceMutation { public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_RECEIVED = "received"; private Long received; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceived = false; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceMutation() {} /** @@ -49,6 +69,7 @@ public BalanceMutation() {} */ public BalanceMutation balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -76,6 +97,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -88,6 +110,7 @@ public void setBalance(Long balance) { */ public BalanceMutation currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -115,6 +138,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -127,6 +151,7 @@ public void setCurrency(String currency) { */ public BalanceMutation received(Long received) { this.received = received; + isSetReceived = true; // mark as set return this; } @@ -154,6 +179,7 @@ public Long getReceived() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceived(Long received) { this.received = received; + isSetReceived = true; // mark as set } /** @@ -166,6 +192,7 @@ public void setReceived(Long received) { */ public BalanceMutation reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -193,6 +220,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceMutation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceMutation object is equal to o. */ @@ -238,6 +286,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetReceived) { + addIfNull(nulls, JSON_PROPERTY_RECEIVED, this.received); + } + if (isSetReserved) { + addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceMutation given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/BankAccountV3.java b/src/main/java/com/adyen/model/transfers/BankAccountV3.java index 3d1a99a35..ea14c090c 100644 --- a/src/main/java/com/adyen/model/transfers/BankAccountV3.java +++ b/src/main/java/com/adyen/model/transfers/BankAccountV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -20,15 +22,34 @@ /** BankAccountV3 */ @JsonPropertyOrder({ BankAccountV3.JSON_PROPERTY_ACCOUNT_HOLDER, - BankAccountV3.JSON_PROPERTY_ACCOUNT_IDENTIFICATION + BankAccountV3.JSON_PROPERTY_ACCOUNT_IDENTIFICATION, + BankAccountV3.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID }) public class BankAccountV3 { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private PartyIdentification accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountV3AccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountV3() {} /** @@ -39,6 +60,7 @@ public BankAccountV3() {} */ public BankAccountV3 accountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -62,6 +84,7 @@ public PartyIdentification getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -73,6 +96,7 @@ public void setAccountHolder(PartyIdentification accountHolder) { public BankAccountV3 accountIdentification( BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -96,6 +120,68 @@ public BankAccountV3AccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @param storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + * @return the current {@code BankAccountV3} instance, allowing for method chaining + */ + public BankAccountV3 storedPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + return this; + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @return storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredPaymentMethodId() { + return storedPaymentMethodId; + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @param storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountV3 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankAccountV3 object is equal to o. */ @@ -109,12 +195,13 @@ public boolean equals(Object o) { } BankAccountV3 bankAccountV3 = (BankAccountV3) o; return Objects.equals(this.accountHolder, bankAccountV3.accountHolder) - && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification); + && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification) + && Objects.equals(this.storedPaymentMethodId, bankAccountV3.storedPaymentMethodId); } @Override public int hashCode() { - return Objects.hash(accountHolder, accountIdentification); + return Objects.hash(accountHolder, accountIdentification, storedPaymentMethodId); } @Override @@ -125,6 +212,9 @@ public String toString() { sb.append(" accountIdentification: ") .append(toIndentedString(accountIdentification)) .append("\n"); + sb.append(" storedPaymentMethodId: ") + .append(toIndentedString(storedPaymentMethodId)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -139,6 +229,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankAccountV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/BankCategoryData.java b/src/main/java/com/adyen/model/transfers/BankCategoryData.java index cbd1399b2..527bd77b8 100644 --- a/src/main/java/com/adyen/model/transfers/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transfers/BankCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,14 +29,14 @@ public class BankCategoryData { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ public enum PriorityEnum { @@ -88,6 +90,9 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + /** **bank** */ public enum TypeEnum { BANK(String.valueOf("bank")); @@ -130,62 +135,72 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankCategoryData() {} /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * @return the current {@code BankCategoryData} instance, allowing for method chaining */ public BankCategoryData priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @return priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @@ -197,32 +212,33 @@ public PriorityEnum getPriority() { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -233,6 +249,7 @@ public void setPriority(PriorityEnum priority) { */ public BankCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -256,6 +273,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankCategoryData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankCategoryData object is equal to o. */ @@ -297,6 +335,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java index 648bb2325..068cac3d1 100644 --- a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,6 +35,9 @@ public class CALocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -79,12 +84,21 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_INSTITUTION_NUMBER = "institutionNumber"; private String institutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; private String transitNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + /** **caLocal** */ public enum TypeEnum { CALOCAL(String.valueOf("caLocal")); @@ -127,6 +141,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CALocalAccountIdentification() {} /** @@ -137,6 +160,7 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -160,6 +184,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -171,6 +196,7 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -196,6 +222,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -206,6 +233,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set return this; } @@ -229,6 +257,7 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set } /** @@ -239,6 +268,7 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set return this; } @@ -262,6 +292,7 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set } /** @@ -272,6 +303,7 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -295,6 +327,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CALocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CALocalAccountIdentification object is equal to o. */ @@ -342,6 +395,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java index b07f74868..4522b55eb 100644 --- a/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class CZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **czLocal** */ public enum TypeEnum { CZLOCAL(String.valueOf("czLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CZLocalAccountIdentification() {} /** @@ -94,6 +111,7 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -133,6 +151,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CZLocalAccountIdentification object is equal to o. */ @@ -242,6 +285,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java b/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java index 86903a5b6..bb3e61236 100644 --- a/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java +++ b/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class CancelTransfersRequest { public static final String JSON_PROPERTY_TRANSFER_IDS = "transferIds"; private List transferIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CancelTransfersRequest() {} /** @@ -35,6 +46,7 @@ public CancelTransfersRequest() {} */ public CancelTransfersRequest transferIds(List transferIds) { this.transferIds = transferIds; + isSetTransferIds = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getTransferIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferIds(List transferIds) { this.transferIds = transferIds; + isSetTransferIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CancelTransfersRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CancelTransfersRequest object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransferIds) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_IDS, this.transferIds); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CancelTransfersRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CapitalBalance.java b/src/main/java/com/adyen/model/transfers/CapitalBalance.java index c8fe68990..d0bf59d1d 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalBalance.java +++ b/src/main/java/com/adyen/model/transfers/CapitalBalance.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class CapitalBalance { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_FEE = "fee"; private Long fee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + public static final String JSON_PROPERTY_PRINCIPAL = "principal"; private Long principal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipal = false; + public static final String JSON_PROPERTY_TOTAL = "total"; private Long total; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalBalance() {} /** @@ -49,6 +69,7 @@ public CapitalBalance() {} */ public CapitalBalance currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -76,6 +97,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -86,6 +108,7 @@ public void setCurrency(String currency) { */ public CapitalBalance fee(Long fee) { this.fee = fee; + isSetFee = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Long getFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFee(Long fee) { this.fee = fee; + isSetFee = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setFee(Long fee) { */ public CapitalBalance principal(Long principal) { this.principal = principal; + isSetPrincipal = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Long getPrincipal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrincipal(Long principal) { this.principal = principal; + isSetPrincipal = true; // mark as set } /** @@ -152,6 +178,7 @@ public void setPrincipal(Long principal) { */ public CapitalBalance total(Long total) { this.total = total; + isSetTotal = true; // mark as set return this; } @@ -175,6 +202,27 @@ public Long getTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotal(Long total) { this.total = total; + isSetTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalBalance includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapitalBalance object is equal to o. */ @@ -220,6 +268,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetPrincipal) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL, this.principal); + } + if (isSetTotal) { + addIfNull(nulls, JSON_PROPERTY_TOTAL, this.total); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapitalBalance given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrant.java b/src/main/java/com/adyen/model/transfers/CapitalGrant.java index 898c8a4d4..92af073c4 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrant.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrant.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,27 +39,51 @@ public class CapitalGrant { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private CapitalBalance balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private Counterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_FEE = "fee"; private Fee fee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + public static final String JSON_PROPERTY_GRANT_ACCOUNT_ID = "grantAccountId"; private String grantAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantAccountId = false; + public static final String JSON_PROPERTY_GRANT_OFFER_ID = "grantOfferId"; private String grantOfferId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOfferId = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REPAYMENT = "repayment"; private Repayment repayment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepayment = false; + /** * The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**, * **WrittenOff**, **Failed**, **Revoked**. @@ -113,6 +139,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalGrant() {} /** @@ -123,6 +158,7 @@ public CapitalGrant() {} */ public CapitalGrant amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -146,6 +182,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -156,6 +193,7 @@ public void setAmount(Amount amount) { */ public CapitalGrant balances(CapitalBalance balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -179,6 +217,7 @@ public CapitalBalance getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(CapitalBalance balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -189,6 +228,7 @@ public void setBalances(CapitalBalance balances) { */ public CapitalGrant counterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -212,6 +252,7 @@ public Counterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -222,6 +263,7 @@ public void setCounterparty(Counterparty counterparty) { */ public CapitalGrant fee(Fee fee) { this.fee = fee; + isSetFee = true; // mark as set return this; } @@ -245,6 +287,7 @@ public Fee getFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFee(Fee fee) { this.fee = fee; + isSetFee = true; // mark as set } /** @@ -255,6 +298,7 @@ public void setFee(Fee fee) { */ public CapitalGrant grantAccountId(String grantAccountId) { this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set return this; } @@ -278,6 +322,7 @@ public String getGrantAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantAccountId(String grantAccountId) { this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set } /** @@ -290,6 +335,7 @@ public void setGrantAccountId(String grantAccountId) { */ public CapitalGrant grantOfferId(String grantOfferId) { this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set return this; } @@ -317,6 +363,7 @@ public String getGrantOfferId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantOfferId(String grantOfferId) { this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set } /** @@ -327,6 +374,7 @@ public void setGrantOfferId(String grantOfferId) { */ public CapitalGrant id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -350,6 +398,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -360,6 +409,7 @@ public void setId(String id) { */ public CapitalGrant repayment(Repayment repayment) { this.repayment = repayment; + isSetRepayment = true; // mark as set return this; } @@ -383,6 +433,7 @@ public Repayment getRepayment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRepayment(Repayment repayment) { this.repayment = repayment; + isSetRepayment = true; // mark as set } /** @@ -395,6 +446,7 @@ public void setRepayment(Repayment repayment) { */ public CapitalGrant status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -422,6 +474,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalGrant includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapitalGrant object is equal to o. */ @@ -478,6 +551,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetGrantAccountId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ACCOUNT_ID, this.grantAccountId); + } + if (isSetGrantOfferId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFER_ID, this.grantOfferId); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRepayment) { + addIfNull(nulls, JSON_PROPERTY_REPAYMENT, this.repayment); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapitalGrant given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java b/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java index 2ba854c7f..70459e15d 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class CapitalGrantInfo { public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private Counterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_GRANT_ACCOUNT_ID = "grantAccountId"; private String grantAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantAccountId = false; + public static final String JSON_PROPERTY_GRANT_OFFER_ID = "grantOfferId"; private String grantOfferId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOfferId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalGrantInfo() {} /** @@ -43,6 +60,7 @@ public CapitalGrantInfo() {} */ public CapitalGrantInfo counterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -66,6 +84,7 @@ public Counterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCounterparty(Counterparty counterparty) { */ public CapitalGrantInfo grantAccountId(String grantAccountId) { this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getGrantAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantAccountId(String grantAccountId) { this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set } /** @@ -111,6 +132,7 @@ public void setGrantAccountId(String grantAccountId) { */ public CapitalGrantInfo grantOfferId(String grantOfferId) { this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getGrantOfferId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantOfferId(String grantOfferId) { this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalGrantInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapitalGrantInfo object is equal to o. */ @@ -181,6 +224,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetGrantAccountId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ACCOUNT_ID, this.grantAccountId); + } + if (isSetGrantOfferId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFER_ID, this.grantOfferId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapitalGrantInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrants.java b/src/main/java/com/adyen/model/transfers/CapitalGrants.java index d3587db82..52e51bb38 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrants.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrants.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class CapitalGrants { public static final String JSON_PROPERTY_GRANTS = "grants"; private List grants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrants = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalGrants() {} /** @@ -35,6 +46,7 @@ public CapitalGrants() {} */ public CapitalGrants grants(List grants) { this.grants = grants; + isSetGrants = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getGrants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrants(List grants) { this.grants = grants; + isSetGrants = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalGrants includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapitalGrants object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetGrants) { + addIfNull(nulls, JSON_PROPERTY_GRANTS, this.grants); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapitalGrants given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Card.java b/src/main/java/com/adyen/model/transfers/Card.java index cc75ab40a..34c3f1854 100644 --- a/src/main/java/com/adyen/model/transfers/Card.java +++ b/src/main/java/com/adyen/model/transfers/Card.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Card { public static final String JSON_PROPERTY_CARD_HOLDER = "cardHolder"; private PartyIdentification cardHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolder = false; + public static final String JSON_PROPERTY_CARD_IDENTIFICATION = "cardIdentification"; private CardIdentification cardIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIdentification = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Card() {} /** @@ -36,6 +50,7 @@ public Card() {} */ public Card cardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set return this; } @@ -59,6 +74,7 @@ public PartyIdentification getCardHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCardHolder(PartyIdentification cardHolder) { */ public Card cardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set return this; } @@ -92,6 +109,27 @@ public CardIdentification getCardIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Card includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Card object is equal to o. */ @@ -133,6 +171,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardHolder) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER, this.cardHolder); + } + if (isSetCardIdentification) { + addIfNull(nulls, JSON_PROPERTY_CARD_IDENTIFICATION, this.cardIdentification); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Card given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CardIdentification.java b/src/main/java/com/adyen/model/transfers/CardIdentification.java index 01ae824fd..97fc4d3ad 100644 --- a/src/main/java/com/adyen/model/transfers/CardIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CardIdentification.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,24 +33,51 @@ public class CardIdentification { public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_ISSUE_NUMBER = "issueNumber"; private String issueNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssueNumber = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_START_MONTH = "startMonth"; private String startMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartMonth = false; + public static final String JSON_PROPERTY_START_YEAR = "startYear"; private String startYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartYear = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardIdentification() {} /** @@ -61,6 +90,7 @@ public CardIdentification() {} */ public CardIdentification expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -88,6 +118,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -98,6 +129,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardIdentification expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -121,6 +153,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -131,6 +164,7 @@ public void setExpiryYear(String expiryYear) { */ public CardIdentification issueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set return this; } @@ -154,6 +188,7 @@ public String getIssueNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set } /** @@ -166,6 +201,7 @@ public void setIssueNumber(String issueNumber) { */ public CardIdentification number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -193,6 +229,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -206,6 +243,7 @@ public void setNumber(String number) { */ public CardIdentification startMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set return this; } @@ -235,6 +273,7 @@ public String getStartMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set } /** @@ -247,6 +286,7 @@ public void setStartMonth(String startMonth) { */ public CardIdentification startYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set return this; } @@ -274,6 +314,7 @@ public String getStartYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set } /** @@ -288,6 +329,7 @@ public void setStartYear(String startYear) { */ public CardIdentification storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -319,6 +361,27 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardIdentification object is equal to o. */ @@ -373,6 +436,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetIssueNumber) { + addIfNull(nulls, JSON_PROPERTY_ISSUE_NUMBER, this.issueNumber); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetStartMonth) { + addIfNull(nulls, JSON_PROPERTY_START_MONTH, this.startMonth); + } + if (isSetStartYear) { + addIfNull(nulls, JSON_PROPERTY_START_YEAR, this.startYear); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java b/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java index d21e99954..60bfeb534 100644 --- a/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -75,6 +77,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The type of the tracking event. Possible values: - **confirmation**: the transfer passed * Adyen's internal review. @@ -120,6 +125,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ConfirmationTrackingData() {} /** @@ -134,6 +148,7 @@ public ConfirmationTrackingData() {} */ public ConfirmationTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -165,6 +180,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -177,6 +193,7 @@ public void setStatus(StatusEnum status) { */ public ConfirmationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -204,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ConfirmationTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ConfirmationTrackingData object is equal to o. */ @@ -245,6 +283,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ConfirmationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Counterparty.java b/src/main/java/com/adyen/model/transfers/Counterparty.java index d7776c09c..73972f0d2 100644 --- a/src/main/java/com/adyen/model/transfers/Counterparty.java +++ b/src/main/java/com/adyen/model/transfers/Counterparty.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class Counterparty { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Counterparty() {} /** @@ -46,6 +63,7 @@ public Counterparty() {} */ public Counterparty accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -75,6 +93,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -86,6 +105,7 @@ public void setAccountHolderId(String accountHolderId) { */ public Counterparty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -111,6 +131,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -123,6 +144,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public Counterparty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -150,6 +172,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Counterparty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Counterparty object is equal to o. */ @@ -195,6 +238,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Counterparty given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java b/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java index ab07377da..b80beb42e 100644 --- a/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java +++ b/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class CounterpartyInfoV3 { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyInfoV3() {} /** @@ -49,6 +69,7 @@ public CounterpartyInfoV3() {} */ public CounterpartyInfoV3 balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -76,6 +97,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -86,6 +108,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public CounterpartyInfoV3 bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -109,6 +132,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public CounterpartyInfoV3 card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -154,6 +180,7 @@ public void setCard(Card card) { */ public CounterpartyInfoV3 transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -181,6 +208,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyInfoV3 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CounterpartyInfoV3 object is equal to o. */ @@ -228,6 +276,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CounterpartyInfoV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CounterpartyV3.java b/src/main/java/com/adyen/model/transfers/CounterpartyV3.java index e9fb906e3..1dff3d7d5 100644 --- a/src/main/java/com/adyen/model/transfers/CounterpartyV3.java +++ b/src/main/java/com/adyen/model/transfers/CounterpartyV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class CounterpartyV3 { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_MERCHANT = "merchant"; private MerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyV3() {} /** @@ -53,6 +76,7 @@ public CounterpartyV3() {} */ public CounterpartyV3 balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -80,6 +104,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -90,6 +115,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public CounterpartyV3 bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -113,6 +139,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -123,6 +150,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public CounterpartyV3 card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -146,6 +174,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -156,6 +185,7 @@ public void setCard(Card card) { */ public CounterpartyV3 merchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -179,6 +209,7 @@ public MerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -191,6 +222,7 @@ public void setMerchant(MerchantData merchant) { */ public CounterpartyV3 transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -218,6 +250,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyV3 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CounterpartyV3 object is equal to o. */ @@ -267,6 +320,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CounterpartyV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java index 1531d3128..549c47489 100644 --- a/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class DKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **dkLocal** */ public enum TypeEnum { DKLOCAL(String.valueOf("dkLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DKLocalAccountIdentification() {} /** @@ -87,6 +104,7 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -112,6 +130,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DKLocalAccountIdentification object is equal to o. */ @@ -222,6 +265,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java b/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java index 957c0e11a..dbeb2d8c7 100644 --- a/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java +++ b/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,15 +31,33 @@ public class DirectDebitInformation { public static final String JSON_PROPERTY_DATE_OF_SIGNATURE = "dateOfSignature"; private OffsetDateTime dateOfSignature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfSignature = false; + public static final String JSON_PROPERTY_DUE_DATE = "dueDate"; private OffsetDateTime dueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDueDate = false; + public static final String JSON_PROPERTY_MANDATE_ID = "mandateId"; private String mandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandateId = false; + public static final String JSON_PROPERTY_SEQUENCE_TYPE = "sequenceType"; private String sequenceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DirectDebitInformation() {} /** @@ -50,6 +70,7 @@ public DirectDebitInformation() {} */ public DirectDebitInformation dateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set return this; } @@ -77,6 +98,7 @@ public OffsetDateTime getDateOfSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set } /** @@ -87,6 +109,7 @@ public void setDateOfSignature(OffsetDateTime dateOfSignature) { */ public DirectDebitInformation dueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set return this; } @@ -110,6 +133,7 @@ public OffsetDateTime getDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set } /** @@ -120,6 +144,7 @@ public void setDueDate(OffsetDateTime dueDate) { */ public DirectDebitInformation mandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set return this; } @@ -143,6 +168,7 @@ public String getMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set } /** @@ -155,6 +181,7 @@ public void setMandateId(String mandateId) { */ public DirectDebitInformation sequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set return this; } @@ -182,6 +209,27 @@ public String getSequenceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DirectDebitInformation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DirectDebitInformation object is equal to o. */ @@ -227,6 +275,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDateOfSignature) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_SIGNATURE, this.dateOfSignature); + } + if (isSetDueDate) { + addIfNull(nulls, JSON_PROPERTY_DUE_DATE, this.dueDate); + } + if (isSetMandateId) { + addIfNull(nulls, JSON_PROPERTY_MANDATE_ID, this.mandateId); + } + if (isSetSequenceType) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_TYPE, this.sequenceType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DirectDebitInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java b/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java index f6242456e..cda7d561b 100644 --- a/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class EstimationTrackingData { public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + /** * The type of tracking event. Possible values: - **estimation**: the estimated date and time of * when the funds will be credited has been determined. @@ -76,6 +81,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EstimationTrackingData() {} /** @@ -86,6 +100,7 @@ public EstimationTrackingData() {} */ public EstimationTrackingData estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -110,6 +125,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -122,6 +138,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public EstimationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -149,6 +166,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EstimationTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EstimationTrackingData object is equal to o. */ @@ -192,6 +230,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EstimationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ExecutionDate.java b/src/main/java/com/adyen/model/transfers/ExecutionDate.java index 7ad4cb2eb..fba85afd0 100644 --- a/src/main/java/com/adyen/model/transfers/ExecutionDate.java +++ b/src/main/java/com/adyen/model/transfers/ExecutionDate.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -24,9 +26,21 @@ public class ExecutionDate { public static final String JSON_PROPERTY_DATE = "date"; private LocalDate date; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDate = false; + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; private String timezone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimezone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExecutionDate() {} /** @@ -43,6 +57,7 @@ public ExecutionDate() {} */ public ExecutionDate date(LocalDate date) { this.date = date; + isSetDate = true; // mark as set return this; } @@ -78,6 +93,7 @@ public LocalDate getDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDate(LocalDate date) { this.date = date; + isSetDate = true; // mark as set } /** @@ -92,6 +108,7 @@ public void setDate(LocalDate date) { */ public ExecutionDate timezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set return this; } @@ -123,6 +140,27 @@ public String getTimezone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExecutionDate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ExecutionDate object is equal to o. */ @@ -164,6 +202,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDate) { + addIfNull(nulls, JSON_PROPERTY_DATE, this.date); + } + if (isSetTimezone) { + addIfNull(nulls, JSON_PROPERTY_TIMEZONE, this.timezone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ExecutionDate given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ExternalReason.java b/src/main/java/com/adyen/model/transfers/ExternalReason.java index 24ddccc88..ce5b33864 100644 --- a/src/main/java/com/adyen/model/transfers/ExternalReason.java +++ b/src/main/java/com/adyen/model/transfers/ExternalReason.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ExternalReason { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; private String namespace; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNamespace = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExternalReason() {} /** @@ -43,6 +60,7 @@ public ExternalReason() {} */ public ExternalReason code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCode(String code) { */ public ExternalReason description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setDescription(String description) { */ public ExternalReason namespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getNamespace() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNamespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExternalReason includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ExternalReason object is equal to o. */ @@ -175,6 +218,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetNamespace) { + addIfNull(nulls, JSON_PROPERTY_NAMESPACE, this.namespace); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ExternalReason given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Fee.java b/src/main/java/com/adyen/model/transfers/Fee.java index f02f6f94b..6dd6ecb78 100644 --- a/src/main/java/com/adyen/model/transfers/Fee.java +++ b/src/main/java/com/adyen/model/transfers/Fee.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class Fee { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Fee() {} /** @@ -33,6 +44,7 @@ public Fee() {} */ public Fee amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Fee includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Fee object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Fee given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java b/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java index 3f5c2509c..244d68230 100644 --- a/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java +++ b/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class FindTransfersResponse { public static final String JSON_PROPERTY_LINKS = "_links"; private Links links; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLinks = false; + public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FindTransfersResponse() {} /** @@ -41,6 +55,7 @@ public FindTransfersResponse() {} */ public FindTransfersResponse links(Links links) { this.links = links; + isSetLinks = true; // mark as set return this; } @@ -64,6 +79,7 @@ public Links getLinks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLinks(Links links) { this.links = links; + isSetLinks = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setLinks(Links links) { */ public FindTransfersResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FindTransfersResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this FindTransfersResponse object is equal to o. */ @@ -146,6 +184,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLinks) { + addIfNull(nulls, JSON_PROPERTY_LINKS, this.links); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of FindTransfersResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/FundingInstrument.java b/src/main/java/com/adyen/model/transfers/FundingInstrument.java new file mode 100644 index 000000000..3ad99878e --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/FundingInstrument.java @@ -0,0 +1,385 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.transfers; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** FundingInstrument */ +@JsonPropertyOrder({ + FundingInstrument.JSON_PROPERTY_CARD_IDENTIFICATION, + FundingInstrument.JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE, + FundingInstrument.JSON_PROPERTY_REFERENCE, + FundingInstrument.JSON_PROPERTY_SOURCE_OF_FUNDS +}) +public class FundingInstrument { + public static final String JSON_PROPERTY_CARD_IDENTIFICATION = "cardIdentification"; + private CardIdentification cardIdentification; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIdentification = false; + + public static final String JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE = "networkPaymentReference"; + private String networkPaymentReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkPaymentReference = false; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Indicates where the funds used for the transfer originated. Possible values are: - **DEBIT** + * for card-to-card transfers. - **DEPOSIT_ACCOUNT** for wallet-to-card transfers. + */ + public enum SourceOfFundsEnum { + DEBIT(String.valueOf("DEBIT")), + + DEPOSIT_ACCOUNT(String.valueOf("DEPOSIT_ACCOUNT")); + + private static final Logger LOG = Logger.getLogger(SourceOfFundsEnum.class.getName()); + + private String value; + + SourceOfFundsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SourceOfFundsEnum fromValue(String value) { + for (SourceOfFundsEnum b : SourceOfFundsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "SourceOfFundsEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(SourceOfFundsEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_SOURCE_OF_FUNDS = "sourceOfFunds"; + private SourceOfFundsEnum sourceOfFunds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSourceOfFunds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public FundingInstrument() {} + + /** + * cardIdentification + * + * @param cardIdentification + * @return the current {@code FundingInstrument} instance, allowing for method chaining + */ + public FundingInstrument cardIdentification(CardIdentification cardIdentification) { + this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set + return this; + } + + /** + * Get cardIdentification + * + * @return cardIdentification + */ + @JsonProperty(JSON_PROPERTY_CARD_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardIdentification getCardIdentification() { + return cardIdentification; + } + + /** + * cardIdentification + * + * @param cardIdentification + */ + @JsonProperty(JSON_PROPERTY_CARD_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardIdentification(CardIdentification cardIdentification) { + this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set + } + + /** + * The unique reference assigned by the card network for the pay-in transaction. + * + * @param networkPaymentReference The unique reference assigned by the card network for the pay-in + * transaction. + * @return the current {@code FundingInstrument} instance, allowing for method chaining + */ + public FundingInstrument networkPaymentReference(String networkPaymentReference) { + this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set + return this; + } + + /** + * The unique reference assigned by the card network for the pay-in transaction. + * + * @return networkPaymentReference The unique reference assigned by the card network for the + * pay-in transaction. + */ + @JsonProperty(JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNetworkPaymentReference() { + return networkPaymentReference; + } + + /** + * The unique reference assigned by the card network for the pay-in transaction. + * + * @param networkPaymentReference The unique reference assigned by the card network for the pay-in + * transaction. + */ + @JsonProperty(JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworkPaymentReference(String networkPaymentReference) { + this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set + } + + /** + * Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + * + * @param reference Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + * @return the current {@code FundingInstrument} instance, allowing for method chaining + */ + public FundingInstrument reference(String reference) { + this.reference = reference; + isSetReference = true; // mark as set + return this; + } + + /** + * Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + * + * @return reference Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + * + * @param reference Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Indicates where the funds used for the transfer originated. Possible values are: - **DEBIT** + * for card-to-card transfers. - **DEPOSIT_ACCOUNT** for wallet-to-card transfers. + * + * @param sourceOfFunds Indicates where the funds used for the transfer originated. Possible + * values are: - **DEBIT** for card-to-card transfers. - **DEPOSIT_ACCOUNT** for + * wallet-to-card transfers. + * @return the current {@code FundingInstrument} instance, allowing for method chaining + */ + public FundingInstrument sourceOfFunds(SourceOfFundsEnum sourceOfFunds) { + this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set + return this; + } + + /** + * Indicates where the funds used for the transfer originated. Possible values are: - **DEBIT** + * for card-to-card transfers. - **DEPOSIT_ACCOUNT** for wallet-to-card transfers. + * + * @return sourceOfFunds Indicates where the funds used for the transfer originated. Possible + * values are: - **DEBIT** for card-to-card transfers. - **DEPOSIT_ACCOUNT** for + * wallet-to-card transfers. + */ + @JsonProperty(JSON_PROPERTY_SOURCE_OF_FUNDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SourceOfFundsEnum getSourceOfFunds() { + return sourceOfFunds; + } + + /** + * Indicates where the funds used for the transfer originated. Possible values are: - **DEBIT** + * for card-to-card transfers. - **DEPOSIT_ACCOUNT** for wallet-to-card transfers. + * + * @param sourceOfFunds Indicates where the funds used for the transfer originated. Possible + * values are: - **DEBIT** for card-to-card transfers. - **DEPOSIT_ACCOUNT** for + * wallet-to-card transfers. + */ + @JsonProperty(JSON_PROPERTY_SOURCE_OF_FUNDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceOfFunds(SourceOfFundsEnum sourceOfFunds) { + this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundingInstrument includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this FundingInstrument object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FundingInstrument fundingInstrument = (FundingInstrument) o; + return Objects.equals(this.cardIdentification, fundingInstrument.cardIdentification) + && Objects.equals(this.networkPaymentReference, fundingInstrument.networkPaymentReference) + && Objects.equals(this.reference, fundingInstrument.reference) + && Objects.equals(this.sourceOfFunds, fundingInstrument.sourceOfFunds); + } + + @Override + public int hashCode() { + return Objects.hash(cardIdentification, networkPaymentReference, reference, sourceOfFunds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FundingInstrument {\n"); + sb.append(" cardIdentification: ").append(toIndentedString(cardIdentification)).append("\n"); + sb.append(" networkPaymentReference: ") + .append(toIndentedString(networkPaymentReference)) + .append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" sourceOfFunds: ").append(toIndentedString(sourceOfFunds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardIdentification) { + addIfNull(nulls, JSON_PROPERTY_CARD_IDENTIFICATION, this.cardIdentification); + } + if (isSetNetworkPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE, this.networkPaymentReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSourceOfFunds) { + addIfNull(nulls, JSON_PROPERTY_SOURCE_OF_FUNDS, this.sourceOfFunds); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of FundingInstrument given an JSON string + * + * @param jsonString JSON string + * @return An instance of FundingInstrument + * @throws JsonProcessingException if the JSON string is invalid with respect to FundingInstrument + */ + public static FundingInstrument fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, FundingInstrument.class); + } + + /** + * Convert an instance of FundingInstrument to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java index ab1c0d102..b60a9b398 100644 --- a/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class HKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; private String clearingCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + /** **hkLocal** */ public enum TypeEnum { HKLOCAL(String.valueOf("hkLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public HKLocalAccountIdentification() {} /** @@ -88,6 +105,7 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -115,6 +133,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this HKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java index 4af658eaa..48eae4a44 100644 --- a/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class HULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **huLocal** */ public enum TypeEnum { HULOCAL(String.valueOf("huLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public HULocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this HULocalAccountIdentification object is equal to o. */ @@ -179,6 +217,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java b/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java index c31dce55f..cd06b751e 100644 --- a/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IbanAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IbanAccountIdentification object is equal to o. */ @@ -185,6 +223,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/InternalCategoryData.java b/src/main/java/com/adyen/model/transfers/InternalCategoryData.java index e6957c996..c2894cdf1 100644 --- a/src/main/java/com/adyen/model/transfers/InternalCategoryData.java +++ b/src/main/java/com/adyen/model/transfers/InternalCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +34,15 @@ public class InternalCategoryData { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + /** **internal** */ public enum TypeEnum { INTERNAL(String.valueOf("internal")); @@ -77,6 +85,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InternalCategoryData() {} /** @@ -88,6 +105,7 @@ public InternalCategoryData() {} */ public InternalCategoryData modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -113,6 +131,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public InternalCategoryData modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public InternalCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InternalCategoryData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InternalCategoryData object is equal to o. */ @@ -228,6 +271,37 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InternalCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java b/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java index a8b36278a..d88c3cbe0 100644 --- a/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -74,6 +76,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** * The status of the transfer. Possible values: - **pending**: the transfer is under internal * review by Adyen. - **failed**: the transfer failed Adyen's internal review. For details, @@ -122,6 +127,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The type of tracking event. Possible values: - **internalReview**: the transfer was flagged * because it does not comply with Adyen's risk policy. @@ -167,6 +175,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InternalReviewTrackingData() {} /** @@ -182,6 +199,7 @@ public InternalReviewTrackingData() {} */ public InternalReviewTrackingData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -215,6 +233,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -229,6 +248,7 @@ public void setReason(ReasonEnum reason) { */ public InternalReviewTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -260,6 +280,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -272,6 +293,7 @@ public void setStatus(StatusEnum status) { */ public InternalReviewTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -299,6 +321,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InternalReviewTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InternalReviewTrackingData object is equal to o. */ @@ -342,6 +385,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InternalReviewTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/InvalidField.java b/src/main/java/com/adyen/model/transfers/InvalidField.java index 59b4a67d9..f09cef9d8 100644 --- a/src/main/java/com/adyen/model/transfers/InvalidField.java +++ b/src/main/java/com/adyen/model/transfers/InvalidField.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class InvalidField { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InvalidField() {} /** @@ -43,6 +60,7 @@ public InvalidField() {} */ public InvalidField message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setMessage(String message) { */ public InvalidField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setName(String name) { */ public InvalidField value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InvalidField object is equal to o. */ @@ -175,6 +218,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InvalidField given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/IssuedCard.java b/src/main/java/com/adyen/model/transfers/IssuedCard.java index 4b1703e41..4da1b877c 100644 --- a/src/main/java/com/adyen/model/transfers/IssuedCard.java +++ b/src/main/java/com/adyen/model/transfers/IssuedCard.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,6 +41,9 @@ public class IssuedCard { public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; private String authorisationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationType = false; + /** * Indicates the method used for entering the PAN to initiate a transaction. Possible values: * **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. @@ -96,6 +101,9 @@ public static PanEntryModeEnum fromValue(String value) { public static final String JSON_PROPERTY_PAN_ENTRY_MODE = "panEntryMode"; private PanEntryModeEnum panEntryMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPanEntryMode = false; + /** * Contains information about how the payment was processed. For example, **ecommerce** for online * or **pos** for in-person payments. @@ -155,19 +163,34 @@ public static ProcessingTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PROCESSING_TYPE = "processingType"; private ProcessingTypeEnum processingType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProcessingType = false; + public static final String JSON_PROPERTY_RELAYED_AUTHORISATION_DATA = "relayedAuthorisationData"; private RelayedAuthorisationData relayedAuthorisationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRelayedAuthorisationData = false; + public static final String JSON_PROPERTY_SCHEME_TRACE_ID = "schemeTraceId"; private String schemeTraceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeTraceId = false; + public static final String JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID = "schemeUniqueTransactionId"; private String schemeUniqueTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeUniqueTransactionId = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private ThreeDSecure threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + /** **issuedCard** */ public enum TypeEnum { ISSUEDCARD(String.valueOf("issuedCard")); @@ -210,9 +233,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VALIDATION_FACTS = "validationFacts"; private List validationFacts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidationFacts = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuedCard() {} /** @@ -225,6 +260,7 @@ public IssuedCard() {} */ public IssuedCard authorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set return this; } @@ -252,6 +288,7 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set } /** @@ -265,6 +302,7 @@ public void setAuthorisationType(String authorisationType) { */ public IssuedCard panEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set return this; } @@ -294,6 +332,7 @@ public PanEntryModeEnum getPanEntryMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPanEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set } /** @@ -306,6 +345,7 @@ public void setPanEntryMode(PanEntryModeEnum panEntryMode) { */ public IssuedCard processingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set return this; } @@ -333,6 +373,7 @@ public ProcessingTypeEnum getProcessingType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set } /** @@ -343,6 +384,7 @@ public void setProcessingType(ProcessingTypeEnum processingType) { */ public IssuedCard relayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set return this; } @@ -366,6 +408,7 @@ public RelayedAuthorisationData getRelayedAuthorisationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set } /** @@ -384,6 +427,7 @@ public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthoris */ public IssuedCard schemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set return this; } @@ -423,6 +467,7 @@ public String getSchemeTraceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set } /** @@ -435,6 +480,7 @@ public void setSchemeTraceId(String schemeTraceId) { */ public IssuedCard schemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set return this; } @@ -462,6 +508,7 @@ public String getSchemeUniqueTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set } /** @@ -472,6 +519,7 @@ public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { */ public IssuedCard threeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -495,6 +543,7 @@ public ThreeDSecure getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -505,6 +554,7 @@ public void setThreeDSecure(ThreeDSecure threeDSecure) { */ public IssuedCard type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -528,6 +578,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -540,6 +591,7 @@ public void setType(TypeEnum type) { */ public IssuedCard validationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set return this; } @@ -575,6 +627,27 @@ public List getValidationFacts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuedCard includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IssuedCard object is equal to o. */ @@ -643,6 +716,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthorisationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); + } + if (isSetPanEntryMode) { + addIfNull(nulls, JSON_PROPERTY_PAN_ENTRY_MODE, this.panEntryMode); + } + if (isSetProcessingType) { + addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPE, this.processingType); + } + if (isSetRelayedAuthorisationData) { + addIfNull(nulls, JSON_PROPERTY_RELAYED_AUTHORISATION_DATA, this.relayedAuthorisationData); + } + if (isSetSchemeTraceId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_TRACE_ID, this.schemeTraceId); + } + if (isSetSchemeUniqueTransactionId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID, this.schemeUniqueTransactionId); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidationFacts) { + addIfNull(nulls, JSON_PROPERTY_VALIDATION_FACTS, this.validationFacts); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IssuedCard given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java b/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java index cc29e4052..69f777d05 100644 --- a/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java +++ b/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class IssuingTransactionData { public static final String JSON_PROPERTY_CAPTURE_CYCLE_ID = "captureCycleId"; private String captureCycleId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureCycleId = false; + /** * The type of events data. Possible values: - **issuingTransactionData**: issuing transaction * data @@ -75,6 +80,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuingTransactionData() {} /** @@ -85,6 +99,7 @@ public IssuingTransactionData() {} */ public IssuingTransactionData captureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set return this; } @@ -108,6 +123,7 @@ public String getCaptureCycleId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set } /** @@ -120,6 +136,7 @@ public void setCaptureCycleId(String captureCycleId) { */ public IssuingTransactionData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -147,6 +164,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuingTransactionData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IssuingTransactionData object is equal to o. */ @@ -188,6 +226,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCaptureCycleId) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_CYCLE_ID, this.captureCycleId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IssuingTransactionData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Leg.java b/src/main/java/com/adyen/model/transfers/Leg.java index 071f3c00e..1876d05eb 100644 --- a/src/main/java/com/adyen/model/transfers/Leg.java +++ b/src/main/java/com/adyen/model/transfers/Leg.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Leg { public static final String JSON_PROPERTY_ARRIVAL_AIRPORT_CODE = "arrivalAirportCode"; private String arrivalAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArrivalAirportCode = false; + public static final String JSON_PROPERTY_BASIC_FARE_CODE = "basicFareCode"; private String basicFareCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasicFareCode = false; + public static final String JSON_PROPERTY_CARRIER_CODE = "carrierCode"; private String carrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierCode = false; + public static final String JSON_PROPERTY_DEPARTURE_AIRPORT_CODE = "departureAirportCode"; private String departureAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureAirportCode = false; + public static final String JSON_PROPERTY_DEPARTURE_DATE = "departureDate"; private String departureDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureDate = false; + public static final String JSON_PROPERTY_FLIGHT_NUMBER = "flightNumber"; private String flightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Leg() {} /** @@ -57,6 +83,7 @@ public Leg() {} */ public Leg arrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getArrivalAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set } /** @@ -94,6 +122,7 @@ public void setArrivalAirportCode(String arrivalAirportCode) { */ public Leg basicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getBasicFareCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set } /** @@ -127,6 +157,7 @@ public void setBasicFareCode(String basicFareCode) { */ public Leg carrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set return this; } @@ -150,6 +181,7 @@ public String getCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set } /** @@ -162,6 +194,7 @@ public void setCarrierCode(String carrierCode) { */ public Leg departureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set return this; } @@ -189,6 +222,7 @@ public String getDepartureAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set } /** @@ -199,6 +233,7 @@ public void setDepartureAirportCode(String departureAirportCode) { */ public Leg departureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set return this; } @@ -222,6 +257,7 @@ public String getDepartureDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set } /** @@ -232,6 +268,7 @@ public void setDepartureDate(String departureDate) { */ public Leg flightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set return this; } @@ -255,6 +292,27 @@ public String getFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Leg includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Leg object is equal to o. */ @@ -312,6 +370,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetArrivalAirportCode) { + addIfNull(nulls, JSON_PROPERTY_ARRIVAL_AIRPORT_CODE, this.arrivalAirportCode); + } + if (isSetBasicFareCode) { + addIfNull(nulls, JSON_PROPERTY_BASIC_FARE_CODE, this.basicFareCode); + } + if (isSetCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_CODE, this.carrierCode); + } + if (isSetDepartureAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_AIRPORT_CODE, this.departureAirportCode); + } + if (isSetDepartureDate) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_DATE, this.departureDate); + } + if (isSetFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_NUMBER, this.flightNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Leg given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Link.java b/src/main/java/com/adyen/model/transfers/Link.java index 592e82816..6b5883fdd 100644 --- a/src/main/java/com/adyen/model/transfers/Link.java +++ b/src/main/java/com/adyen/model/transfers/Link.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class Link { public static final String JSON_PROPERTY_HREF = "href"; private String href; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHref = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Link() {} /** @@ -33,6 +44,7 @@ public Link() {} */ public Link href(String href) { this.href = href; + isSetHref = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getHref() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHref(String href) { this.href = href; + isSetHref = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Link includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Link object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetHref) { + addIfNull(nulls, JSON_PROPERTY_HREF, this.href); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Link given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Links.java b/src/main/java/com/adyen/model/transfers/Links.java index c1bf6d0d9..cf1dd3929 100644 --- a/src/main/java/com/adyen/model/transfers/Links.java +++ b/src/main/java/com/adyen/model/transfers/Links.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Links { public static final String JSON_PROPERTY_NEXT = "next"; private Link next; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNext = false; + public static final String JSON_PROPERTY_PREV = "prev"; private Link prev; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrev = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Links() {} /** @@ -36,6 +50,7 @@ public Links() {} */ public Links next(Link next) { this.next = next; + isSetNext = true; // mark as set return this; } @@ -59,6 +74,7 @@ public Link getNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNext(Link next) { this.next = next; + isSetNext = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setNext(Link next) { */ public Links prev(Link prev) { this.prev = prev; + isSetPrev = true; // mark as set return this; } @@ -92,6 +109,27 @@ public Link getPrev() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrev(Link prev) { this.prev = prev; + isSetPrev = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Links includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Links object is equal to o. */ @@ -132,6 +170,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNext) { + addIfNull(nulls, JSON_PROPERTY_NEXT, this.next); + } + if (isSetPrev) { + addIfNull(nulls, JSON_PROPERTY_PREV, this.prev); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Links given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Lodging.java b/src/main/java/com/adyen/model/transfers/Lodging.java index 8016fcb7e..a6cc992d2 100644 --- a/src/main/java/com/adyen/model/transfers/Lodging.java +++ b/src/main/java/com/adyen/model/transfers/Lodging.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Lodging { public static final String JSON_PROPERTY_CHECK_IN_DATE = "checkInDate"; private String checkInDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckInDate = false; + public static final String JSON_PROPERTY_NUMBER_OF_NIGHTS = "numberOfNights"; private Integer numberOfNights; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfNights = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Lodging() {} /** @@ -36,6 +50,7 @@ public Lodging() {} */ public Lodging checkInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCheckInDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCheckInDate(String checkInDate) { */ public Lodging numberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set return this; } @@ -92,6 +109,27 @@ public Integer getNumberOfNights() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Lodging includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Lodging object is equal to o. */ @@ -133,6 +171,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckInDate) { + addIfNull(nulls, JSON_PROPERTY_CHECK_IN_DATE, this.checkInDate); + } + if (isSetNumberOfNights) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_NIGHTS, this.numberOfNights); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Lodging given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/MerchantData.java b/src/main/java/com/adyen/model/transfers/MerchantData.java index 7882d73b7..794c1299c 100644 --- a/src/main/java/com/adyen/model/transfers/MerchantData.java +++ b/src/main/java/com/adyen/model/transfers/MerchantData.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class MerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_NAME_LOCATION = "nameLocation"; private NameLocation nameLocation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNameLocation = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantData() {} /** @@ -51,6 +74,7 @@ public MerchantData() {} */ public MerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setAcquirerId(String acquirerId) { */ public MerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setMcc(String mcc) { */ public MerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMerchantId(String merchantId) { */ public MerchantData nameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set return this; } @@ -173,6 +203,7 @@ public NameLocation getNameLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setNameLocation(NameLocation nameLocation) { */ public MerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -206,6 +238,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantData object is equal to o. */ @@ -253,6 +306,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetNameLocation) { + addIfNull(nulls, JSON_PROPERTY_NAME_LOCATION, this.nameLocation); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java b/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java index 0346fb7a5..c18c86ea3 100644 --- a/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java +++ b/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +35,15 @@ public class MerchantPurchaseData { public static final String JSON_PROPERTY_AIRLINE = "airline"; private Airline airline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirline = false; + public static final String JSON_PROPERTY_LODGING = "lodging"; private List lodging; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodging = false; + /** * The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data */ @@ -80,6 +88,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantPurchaseData() {} /** @@ -90,6 +107,7 @@ public MerchantPurchaseData() {} */ public MerchantPurchaseData airline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set return this; } @@ -113,6 +131,7 @@ public Airline getAirline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setAirline(Airline airline) { */ public MerchantPurchaseData lodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set return this; } @@ -154,6 +174,7 @@ public List getLodging() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setLodging(List lodging) { */ public MerchantPurchaseData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -190,6 +212,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantPurchaseData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantPurchaseData object is equal to o. */ @@ -233,6 +276,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAirline) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE, this.airline); + } + if (isSetLodging) { + addIfNull(nulls, JSON_PROPERTY_LODGING, this.lodging); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantPurchaseData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Modification.java b/src/main/java/com/adyen/model/transfers/Modification.java index 8a9da3129..a81f3904d 100644 --- a/src/main/java/com/adyen/model/transfers/Modification.java +++ b/src/main/java/com/adyen/model/transfers/Modification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class Modification { public static final String JSON_PROPERTY_DIRECTION = "direction"; private String direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of the transfer event. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -213,9 +224,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Modification() {} /** @@ -226,6 +249,7 @@ public Modification() {} */ public Modification direction(String direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -249,6 +273,7 @@ public String getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(String direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -259,6 +284,7 @@ public void setDirection(String direction) { */ public Modification id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -282,6 +308,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -292,6 +319,7 @@ public void setId(String id) { */ public Modification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -315,6 +343,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -325,6 +354,7 @@ public void setReference(String reference) { */ public Modification status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -348,6 +378,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -358,6 +389,7 @@ public void setStatus(StatusEnum status) { */ public Modification type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -381,6 +413,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Modification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Modification object is equal to o. */ @@ -428,6 +481,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Modification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java index 747425477..446928a2e 100644 --- a/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class NOLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **noLocal** */ public enum TypeEnum { NOLOCAL(String.valueOf("noLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NOLocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NOLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NOLocalAccountIdentification object is equal to o. */ @@ -179,6 +217,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java index 645db8365..43412c13b 100644 --- a/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class NZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **nzLocal** */ public enum TypeEnum { NZLOCAL(String.valueOf("nzLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NZLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NZLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/NameLocation.java b/src/main/java/com/adyen/model/transfers/NameLocation.java index b353fe954..012f51421 100644 --- a/src/main/java/com/adyen/model/transfers/NameLocation.java +++ b/src/main/java/com/adyen/model/transfers/NameLocation.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class NameLocation { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_COUNTRY_OF_ORIGIN = "countryOfOrigin"; private String countryOfOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfOrigin = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_RAW_DATA = "rawData"; private String rawData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRawData = false; + public static final String JSON_PROPERTY_STATE = "state"; private String state; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetState = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NameLocation() {} /** @@ -55,6 +81,7 @@ public NameLocation() {} */ public NameLocation city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -90,6 +118,7 @@ public void setCity(String city) { */ public NameLocation country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -131,6 +161,7 @@ public void setCountry(String country) { */ public NameLocation countryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getCountryOfOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set } /** @@ -172,6 +204,7 @@ public void setCountryOfOrigin(String countryOfOrigin) { */ public NameLocation name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -205,6 +239,7 @@ public void setName(String name) { */ public NameLocation rawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set return this; } @@ -228,6 +263,7 @@ public String getRawData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set } /** @@ -238,6 +274,7 @@ public void setRawData(String rawData) { */ public NameLocation state(String state) { this.state = state; + isSetState = true; // mark as set return this; } @@ -261,6 +298,27 @@ public String getState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setState(String state) { this.state = state; + isSetState = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NameLocation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NameLocation object is equal to o. */ @@ -310,6 +368,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetCountryOfOrigin) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_ORIGIN, this.countryOfOrigin); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetRawData) { + addIfNull(nulls, JSON_PROPERTY_RAW_DATA, this.rawData); + } + if (isSetState) { + addIfNull(nulls, JSON_PROPERTY_STATE, this.state); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NameLocation given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java index 79037ee5e..54e7fd0f3 100644 --- a/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,13 +34,22 @@ public class NumberAndBicAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; private AdditionalBankIdentification additionalBankIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **numberAndBic** */ public enum TypeEnum { NUMBERANDBIC(String.valueOf("numberAndBic")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NumberAndBicAccountIdentification() {} /** @@ -94,6 +114,7 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +142,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -133,6 +155,7 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -157,6 +180,7 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set } /** @@ -168,6 +192,7 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -191,6 +216,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NumberAndBicAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NumberAndBicAccountIdentification object is equal to o. */ @@ -275,6 +323,40 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java index 3158ffe10..b43fcc714 100644 --- a/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class PLLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **plLocal** */ public enum TypeEnum { PLLOCAL(String.valueOf("plLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PLLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PLLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PLLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/PartyIdentification.java b/src/main/java/com/adyen/model/transfers/PartyIdentification.java index f7150a348..af94e1662 100644 --- a/src/main/java/com/adyen/model/transfers/PartyIdentification.java +++ b/src/main/java/com/adyen/model/transfers/PartyIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,24 +40,45 @@ public class PartyIdentification { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The type of entity that owns the bank account or card. Possible values: **individual**, * **organization**, or **unknown**. Required when `category` is **card**. In this case, @@ -106,9 +129,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PartyIdentification() {} /** @@ -119,6 +154,7 @@ public PartyIdentification() {} */ public PartyIdentification address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -142,6 +178,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -155,6 +192,7 @@ public void setAddress(Address address) { */ public PartyIdentification dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -184,6 +222,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -195,6 +234,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PartyIdentification email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -220,6 +260,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -234,6 +275,7 @@ public void setEmail(String email) { */ public PartyIdentification firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -265,6 +307,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -279,6 +322,7 @@ public void setFirstName(String firstName) { */ public PartyIdentification fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -310,6 +354,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -324,6 +369,7 @@ public void setFullName(String fullName) { */ public PartyIdentification lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -355,6 +401,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -369,6 +416,7 @@ public void setLastName(String lastName) { */ public PartyIdentification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -400,6 +448,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -414,6 +463,7 @@ public void setReference(String reference) { */ public PartyIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -445,6 +495,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -455,6 +506,7 @@ public void setType(TypeEnum type) { */ public PartyIdentification url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -478,6 +530,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PartyIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PartyIdentification object is equal to o. */ @@ -534,6 +607,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PartyIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java index 6912fc42a..8a3cabb90 100644 --- a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class PaymentInstrument { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TOKEN_TYPE = "tokenType"; private String tokenType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrument() {} /** @@ -47,6 +67,7 @@ public PaymentInstrument() {} */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setId(String id) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setReference(String reference) { */ public PaymentInstrument tokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getTokenType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrument includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrument object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTokenType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_TYPE, this.tokenType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/PlatformPayment.java b/src/main/java/com/adyen/model/transfers/PlatformPayment.java index 9ca06af66..bbf55b5f6 100644 --- a/src/main/java/com/adyen/model/transfers/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transfers/PlatformPayment.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,33 +37,42 @@ public class PlatformPayment { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + public static final String JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE = "paymentMerchantReference"; private String paymentMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMerchantReference = false; + /** * Specifies the nature of the transfer. This parameter helps categorize transfers so you can * reconcile transactions at a later time, using the Balance Platform Accounting Report for * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. */ public enum PlatformPaymentTypeEnum { @@ -137,9 +148,15 @@ public static PlatformPaymentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PLATFORM_PAYMENT_TYPE = "platformPaymentType"; private PlatformPaymentTypeEnum platformPaymentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentType = false; + public static final String JSON_PROPERTY_PSP_PAYMENT_REFERENCE = "pspPaymentReference"; private String pspPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspPaymentReference = false; + /** **platformPayment** */ public enum TypeEnum { PLATFORMPAYMENT(String.valueOf("platformPayment")); @@ -182,6 +199,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PlatformPayment() {} /** @@ -193,6 +219,7 @@ public PlatformPayment() {} */ public PlatformPayment modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -218,6 +245,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -228,6 +256,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public PlatformPayment modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -251,6 +280,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -261,6 +291,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public PlatformPayment paymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set return this; } @@ -284,6 +315,7 @@ public String getPaymentMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set } /** @@ -292,21 +324,21 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @param platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -315,26 +347,27 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. * @return the current {@code PlatformPayment} instance, allowing for method chaining */ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set return this; } @@ -344,21 +377,21 @@ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPayme * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @return platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -367,22 +400,22 @@ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPayme * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. */ @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -396,21 +429,21 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @param platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -419,27 +452,28 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. */ @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set } /** @@ -450,6 +484,7 @@ public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) */ public PlatformPayment pspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set return this; } @@ -473,6 +508,7 @@ public String getPspPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set } /** @@ -483,6 +519,7 @@ public void setPspPaymentReference(String pspPaymentReference) { */ public PlatformPayment type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +543,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PlatformPayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PlatformPayment object is equal to o. */ @@ -572,6 +630,46 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + if (isSetPaymentMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE, this.paymentMerchantReference); + } + if (isSetPlatformPaymentType) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_PAYMENT_TYPE, this.platformPaymentType); + } + if (isSetPspPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_PAYMENT_REFERENCE, this.pspPaymentReference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PlatformPayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java b/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java index 518283c4c..46e25c37c 100644 --- a/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java +++ b/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class RelayedAuthorisationData { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RelayedAuthorisationData() {} /** @@ -43,6 +57,7 @@ public RelayedAuthorisationData() {} */ public RelayedAuthorisationData metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -78,6 +93,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -88,6 +104,7 @@ public void setMetadata(Map metadata) { */ public RelayedAuthorisationData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -111,6 +128,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RelayedAuthorisationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RelayedAuthorisationData object is equal to o. */ @@ -152,6 +190,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RelayedAuthorisationData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Repayment.java b/src/main/java/com/adyen/model/transfers/Repayment.java index d75ec5fbe..8f37651d1 100644 --- a/src/main/java/com/adyen/model/transfers/Repayment.java +++ b/src/main/java/com/adyen/model/transfers/Repayment.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class Repayment { public static final String JSON_PROPERTY_BASIS_POINTS = "basisPoints"; private Integer basisPoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasisPoints = false; + public static final String JSON_PROPERTY_TERM = "term"; private RepaymentTerm term; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTerm = false; + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; private ThresholdRepayment threshold; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreshold = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Repayment() {} /** @@ -45,6 +62,7 @@ public Repayment() {} */ public Repayment basisPoints(Integer basisPoints) { this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set return this; } @@ -72,6 +90,7 @@ public Integer getBasisPoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasisPoints(Integer basisPoints) { this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setBasisPoints(Integer basisPoints) { */ public Repayment term(RepaymentTerm term) { this.term = term; + isSetTerm = true; // mark as set return this; } @@ -105,6 +125,7 @@ public RepaymentTerm getTerm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTerm(RepaymentTerm term) { this.term = term; + isSetTerm = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setTerm(RepaymentTerm term) { */ public Repayment threshold(ThresholdRepayment threshold) { this.threshold = threshold; + isSetThreshold = true; // mark as set return this; } @@ -138,6 +160,27 @@ public ThresholdRepayment getThreshold() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreshold(ThresholdRepayment threshold) { this.threshold = threshold; + isSetThreshold = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Repayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Repayment object is equal to o. */ @@ -181,6 +224,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBasisPoints) { + addIfNull(nulls, JSON_PROPERTY_BASIS_POINTS, this.basisPoints); + } + if (isSetTerm) { + addIfNull(nulls, JSON_PROPERTY_TERM, this.term); + } + if (isSetThreshold) { + addIfNull(nulls, JSON_PROPERTY_THRESHOLD, this.threshold); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Repayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/RepaymentTerm.java b/src/main/java/com/adyen/model/transfers/RepaymentTerm.java index 1e06dc2ff..bf8cfe6cd 100644 --- a/src/main/java/com/adyen/model/transfers/RepaymentTerm.java +++ b/src/main/java/com/adyen/model/transfers/RepaymentTerm.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class RepaymentTerm { public static final String JSON_PROPERTY_ESTIMATED_DAYS = "estimatedDays"; private Integer estimatedDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedDays = false; + public static final String JSON_PROPERTY_MAXIMUM_DAYS = "maximumDays"; private Integer maximumDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaximumDays = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RepaymentTerm() {} /** @@ -39,6 +53,7 @@ public RepaymentTerm() {} */ public RepaymentTerm estimatedDays(Integer estimatedDays) { this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set return this; } @@ -62,6 +77,7 @@ public Integer getEstimatedDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedDays(Integer estimatedDays) { this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEstimatedDays(Integer estimatedDays) { */ public RepaymentTerm maximumDays(Integer maximumDays) { this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set return this; } @@ -101,6 +118,27 @@ public Integer getMaximumDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaximumDays(Integer maximumDays) { this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RepaymentTerm includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RepaymentTerm object is equal to o. */ @@ -142,6 +180,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEstimatedDays) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_DAYS, this.estimatedDays); + } + if (isSetMaximumDays) { + addIfNull(nulls, JSON_PROPERTY_MAXIMUM_DAYS, this.maximumDays); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RepaymentTerm given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ResourceReference.java b/src/main/java/com/adyen/model/transfers/ResourceReference.java index e25f2a5fc..f718d247e 100644 --- a/src/main/java/com/adyen/model/transfers/ResourceReference.java +++ b/src/main/java/com/adyen/model/transfers/ResourceReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -175,6 +218,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/RestServiceError.java b/src/main/java/com/adyen/model/transfers/RestServiceError.java index 703e3d346..eccc3663d 100644 --- a/src/main/java/com/adyen/model/transfers/RestServiceError.java +++ b/src/main/java/com/adyen/model/transfers/RestServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,30 +37,63 @@ public class RestServiceError { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + public static final String JSON_PROPERTY_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_RESPONSE = "response"; private Object response; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RestServiceError() {} /** @@ -69,6 +104,7 @@ public RestServiceError() {} */ public RestServiceError detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -92,6 +128,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -102,6 +139,7 @@ public void setDetail(String detail) { */ public RestServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -125,6 +163,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -135,6 +174,7 @@ public void setErrorCode(String errorCode) { */ public RestServiceError instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -158,6 +198,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -168,6 +209,7 @@ public void setInstance(String instance) { */ public RestServiceError invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -199,6 +241,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -210,6 +253,7 @@ public void setInvalidFields(List invalidFields) { */ public RestServiceError requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -235,6 +279,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -245,6 +290,7 @@ public void setRequestId(String requestId) { */ public RestServiceError response(Object response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -268,6 +314,7 @@ public Object getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(Object response) { this.response = response; + isSetResponse = true; // mark as set } /** @@ -278,6 +325,7 @@ public void setResponse(Object response) { */ public RestServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -301,6 +349,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -311,6 +360,7 @@ public void setStatus(Integer status) { */ public RestServiceError title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -334,6 +384,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -346,6 +397,7 @@ public void setTitle(String title) { */ public RestServiceError type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -373,6 +425,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RestServiceError includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RestServiceError object is equal to o. */ @@ -429,6 +502,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RestServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java b/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java index 1164e492a..8eaf76f8a 100644 --- a/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java +++ b/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class ReturnTransferRequest { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ReturnTransferRequest() {} /** @@ -39,6 +53,7 @@ public ReturnTransferRequest() {} */ public ReturnTransferRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -62,6 +77,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setAmount(Amount amount) { */ public ReturnTransferRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -116,6 +133,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReturnTransferRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ReturnTransferRequest object is equal to o. */ @@ -157,6 +195,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ReturnTransferRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java b/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java index 1ef2b0bb6..85e02e85d 100644 --- a/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java +++ b/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +34,15 @@ public class ReturnTransferResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The resulting status of the return. Possible values: **Authorised**, **Declined**. */ public enum StatusEnum { AUTHORISED(String.valueOf("Authorised")), @@ -79,9 +87,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TRANSFER_ID = "transferId"; private String transferId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ReturnTransferResponse() {} /** @@ -92,6 +112,7 @@ public ReturnTransferResponse() {} */ public ReturnTransferResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -115,6 +136,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -125,6 +147,7 @@ public void setId(String id) { */ public ReturnTransferResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -148,6 +171,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -159,6 +183,7 @@ public void setReference(String reference) { */ public ReturnTransferResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -184,6 +209,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -194,6 +220,7 @@ public void setStatus(StatusEnum status) { */ public ReturnTransferResponse transferId(String transferId) { this.transferId = transferId; + isSetTransferId = true; // mark as set return this; } @@ -217,6 +244,27 @@ public String getTransferId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferId(String transferId) { this.transferId = transferId; + isSetTransferId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReturnTransferResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ReturnTransferResponse object is equal to o. */ @@ -262,6 +310,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTransferId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_ID, this.transferId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ReturnTransferResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/RoutingDetails.java b/src/main/java/com/adyen/model/transfers/RoutingDetails.java index 52e94e611..e19196fc9 100644 --- a/src/main/java/com/adyen/model/transfers/RoutingDetails.java +++ b/src/main/java/com/adyen/model/transfers/RoutingDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,20 +34,26 @@ public class RoutingDetails { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ public enum PriorityEnum { @@ -99,9 +107,21 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RoutingDetails() {} /** @@ -112,6 +132,7 @@ public RoutingDetails() {} */ public RoutingDetails detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -135,6 +156,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -145,6 +167,7 @@ public void setDetail(String detail) { */ public RoutingDetails errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -168,62 +191,64 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * @return the current {@code RoutingDetails} instance, allowing for method chaining */ public RoutingDetails priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @return priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @@ -235,32 +260,33 @@ public PriorityEnum getPriority() { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -271,6 +297,7 @@ public void setPriority(PriorityEnum priority) { */ public RoutingDetails title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -294,6 +321,27 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RoutingDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RoutingDetails object is equal to o. */ @@ -339,6 +387,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RoutingDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java index 23be7c97b..dad6c2845 100644 --- a/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class SELocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; private String clearingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + /** **seLocal** */ public enum TypeEnum { SELOCAL(String.valueOf("seLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SELocalAccountIdentification() {} /** @@ -90,6 +107,7 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -135,6 +154,7 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SELocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SELocalAccountIdentification object is equal to o. */ @@ -242,6 +285,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java index fca6b4551..d765cfab6 100644 --- a/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class SGLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **sgLocal** */ public enum TypeEnum { SGLOCAL(String.valueOf("sgLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SGLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -142,6 +162,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -152,6 +173,7 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +197,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SGLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SGLocalAccountIdentification object is equal to o. */ @@ -218,6 +261,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ServiceError.java b/src/main/java/com/adyen/model/transfers/ServiceError.java index f16e39b25..3605e106c 100644 --- a/src/main/java/com/adyen/model/transfers/ServiceError.java +++ b/src/main/java/com/adyen/model/transfers/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class ServiceError { public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + public static final String JSON_PROPERTY_ERROR_TYPE = "errorType"; private String errorType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorType = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ServiceError() {} /** @@ -51,6 +74,7 @@ public ServiceError() {} */ public ServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setErrorCode(String errorCode) { */ public ServiceError errorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getErrorType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setErrorType(String errorType) { */ public ServiceError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMessage(String message) { */ public ServiceError pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setPspReference(String pspReference) { */ public ServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -206,6 +238,27 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ServiceError includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ServiceError object is equal to o. */ @@ -253,6 +306,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetErrorType) { + addIfNull(nulls, JSON_PROPERTY_ERROR_TYPE, this.errorType); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ThreeDSecure.java b/src/main/java/com/adyen/model/transfers/ThreeDSecure.java index 57100877c..29d3a0ad8 100644 --- a/src/main/java/com/adyen/model/transfers/ThreeDSecure.java +++ b/src/main/java/com/adyen/model/transfers/ThreeDSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class ThreeDSecure { public static final String JSON_PROPERTY_ACS_TRANSACTION_ID = "acsTransactionId"; private String acsTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransactionId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSecure() {} /** @@ -33,6 +44,7 @@ public ThreeDSecure() {} */ public ThreeDSecure acsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getAcsTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSecure includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDSecure object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcsTransactionId) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANSACTION_ID, this.acsTransactionId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java b/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java index da5c340a2..c1f7d4bfe 100644 --- a/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java +++ b/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class ThresholdRepayment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThresholdRepayment() {} /** @@ -33,6 +44,7 @@ public ThresholdRepayment() {} */ public ThresholdRepayment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThresholdRepayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThresholdRepayment object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThresholdRepayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Transaction.java b/src/main/java/com/adyen/model/transfers/Transaction.java index e2d17457e..154d0bdca 100644 --- a/src/main/java/com/adyen/model/transfers/Transaction.java +++ b/src/main/java/com/adyen/model/transfers/Transaction.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,33 +44,63 @@ public class Transaction { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BOOKING_DATE = "bookingDate"; private OffsetDateTime bookingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBookingDate = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + /** * The status of the transaction. Possible values: * **pending**: The transaction is still * pending. * **booked**: The transaction has been booked to the balance account. @@ -116,12 +148,27 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TRANSFER = "transfer"; private TransferView transfer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransfer = false; + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; private OffsetDateTime valueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Transaction() {} /** @@ -132,6 +179,7 @@ public Transaction() {} */ public Transaction accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -155,6 +203,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -165,6 +214,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public Transaction amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -188,6 +238,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -198,6 +249,7 @@ public void setAmount(Amount amount) { */ public Transaction balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -221,6 +273,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -231,6 +284,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public Transaction balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -254,6 +308,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -264,6 +319,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Transaction bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set return this; } @@ -287,6 +343,7 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set } /** @@ -299,6 +356,7 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public Transaction creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -326,6 +384,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -336,6 +395,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Transaction description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -359,6 +419,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -369,6 +430,7 @@ public void setDescription(String description) { */ public Transaction id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -392,6 +454,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -402,6 +465,7 @@ public void setId(String id) { */ public Transaction paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -425,6 +489,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -444,6 +509,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public Transaction referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -485,6 +551,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -497,6 +564,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public Transaction status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -524,6 +592,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -534,6 +603,7 @@ public void setStatus(StatusEnum status) { */ public Transaction transfer(TransferView transfer) { this.transfer = transfer; + isSetTransfer = true; // mark as set return this; } @@ -557,6 +627,7 @@ public TransferView getTransfer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransfer(TransferView transfer) { this.transfer = transfer; + isSetTransfer = true; // mark as set } /** @@ -567,6 +638,7 @@ public void setTransfer(TransferView transfer) { */ public Transaction valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set return this; } @@ -590,6 +662,27 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Transaction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Transaction object is equal to o. */ @@ -668,6 +761,66 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBookingDate) { + addIfNull(nulls, JSON_PROPERTY_BOOKING_DATE, this.bookingDate); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTransfer) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER, this.transfer); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Transaction given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java b/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java index fdafd0c06..b0f0a562c 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java +++ b/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class TransactionEventViolation { public static final String JSON_PROPERTY_REASON = "reason"; private String reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; private TransactionRuleReference transactionRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRule = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE_SOURCE = "transactionRuleSource"; private TransactionRuleSource transactionRuleSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRuleSource = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionEventViolation() {} /** @@ -43,6 +60,7 @@ public TransactionEventViolation() {} */ public TransactionEventViolation reason(String reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setReason(String reason) { */ public TransactionEventViolation transactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set return this; } @@ -99,6 +119,7 @@ public TransactionRuleReference getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setTransactionRule(TransactionRuleReference transactionRule) { public TransactionEventViolation transactionRuleSource( TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set return this; } @@ -133,6 +155,27 @@ public TransactionRuleSource getTransactionRuleSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRuleSource(TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionEventViolation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionEventViolation object is equal to o. */ @@ -179,6 +222,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetTransactionRule) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); + } + if (isSetTransactionRuleSource) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE_SOURCE, this.transactionRuleSource); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionEventViolation given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java b/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java index 4863931e3..f0e3f97ae 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class TransactionRuleReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private String outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleReference() {} /** @@ -51,6 +74,7 @@ public TransactionRuleReference() {} */ public TransactionRuleReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setDescription(String description) { */ public TransactionRuleReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setId(String id) { */ public TransactionRuleReference outcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setOutcomeType(String outcomeType) { */ public TransactionRuleReference reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -185,6 +216,7 @@ public void setReference(String reference) { */ public TransactionRuleReference score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -212,6 +244,27 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleReference object is equal to o. */ @@ -259,6 +312,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java b/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java index 4b0a7e173..8850739ab 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TransactionRuleSource { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleSource() {} /** @@ -39,6 +53,7 @@ public TransactionRuleSource() {} */ public TransactionRuleSource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setId(String id) { */ public TransactionRuleSource type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleSource includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleSource object is equal to o. */ @@ -154,6 +192,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleSource given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java b/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java index ec5f302c8..8018d4b8f 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,16 +32,34 @@ public class TransactionRulesResult { public static final String JSON_PROPERTY_ADVICE = "advice"; private String advice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdvice = false; + public static final String JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED = "allHardBlockRulesPassed"; private Boolean allHardBlockRulesPassed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllHardBlockRulesPassed = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES = "triggeredTransactionRules"; private List triggeredTransactionRules; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggeredTransactionRules = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRulesResult() {} /** @@ -50,6 +70,7 @@ public TransactionRulesResult() {} */ public TransactionRulesResult advice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set return this; } @@ -73,6 +94,7 @@ public String getAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdvice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAdvice(String advice) { */ public TransactionRulesResult allHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Boolean getAllHardBlockRulesPassed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { */ public TransactionRulesResult score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -154,6 +180,7 @@ public void setScore(Integer score) { public TransactionRulesResult triggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set return this; } @@ -189,6 +216,27 @@ public List getTriggeredTransactionRules() { public void setTriggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRulesResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRulesResult object is equal to o. */ @@ -240,6 +288,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdvice) { + addIfNull(nulls, JSON_PROPERTY_ADVICE, this.advice); + } + if (isSetAllHardBlockRulesPassed) { + addIfNull(nulls, JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED, this.allHardBlockRulesPassed); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetTriggeredTransactionRules) { + addIfNull(nulls, JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES, this.triggeredTransactionRules); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRulesResult given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java index 7f4e62408..a0c6f3ef2 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java +++ b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class TransactionSearchResponse { public static final String JSON_PROPERTY_LINKS = "_links"; private Links links; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLinks = false; + public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionSearchResponse() {} /** @@ -41,6 +55,7 @@ public TransactionSearchResponse() {} */ public TransactionSearchResponse links(Links links) { this.links = links; + isSetLinks = true; // mark as set return this; } @@ -64,6 +79,7 @@ public Links getLinks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLinks(Links links) { this.links = links; + isSetLinks = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setLinks(Links links) { */ public TransactionSearchResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionSearchResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionSearchResponse object is equal to o. */ @@ -146,6 +184,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLinks) { + addIfNull(nulls, JSON_PROPERTY_LINKS, this.links); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionSearchResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index 0ea8a540d..e36e9c67e 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -49,21 +51,30 @@ public class Transfer { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. */ public enum CategoryEnum { BANK(String.valueOf("bank")), @@ -116,25 +127,46 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private CounterpartyV3 counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; @Deprecated // deprecated since Transfers API v3: Use createdAt or updatedAt private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_DIRECT_DEBIT_INFORMATION = "directDebitInformation"; private DirectDebitInformation directDebitInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectDebitInformation = false; + /** The direction of the transfer. Possible values: **incoming**, **outgoing**. */ public enum DirectionEnum { INCOMING(String.valueOf("incoming")), @@ -179,15 +211,27 @@ public static DirectionEnum fromValue(String value) { public static final String JSON_PROPERTY_DIRECTION = "direction"; private DirectionEnum direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_EXECUTION_DATE = "executionDate"; private ExecutionDate executionDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecutionDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + /** Additional information about the status of the transfer. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -237,6 +281,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -279,21 +325,35 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_REVIEW = "review"; private TransferReview review; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReview = false; + /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -468,6 +528,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The type of transfer or transaction. For example, **refund**, **payment**, * **internalTransfer**, **bankTransfer**. @@ -587,6 +650,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Transfer() {} /** @@ -597,6 +669,7 @@ public Transfer() {} */ public Transfer accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -620,6 +693,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -630,6 +704,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public Transfer amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -653,6 +728,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -663,6 +739,7 @@ public void setAmount(Amount amount) { */ public Transfer balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -686,53 +763,55 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. * @return the current {@code Transfer} instance, allowing for method chaining */ public Transfer category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @return category The category of the transfer. Possible values: - **bank**: a transfer + * @return category The category of the transfer. Possible values: - **bank**: A transfer * involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -741,29 +820,30 @@ public CategoryEnum getCategory() { } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -774,6 +854,7 @@ public void setCategory(CategoryEnum category) { */ public Transfer categoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -797,6 +878,7 @@ public TransferCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -807,6 +889,7 @@ public void setCategoryData(TransferCategoryData categoryData) { */ public Transfer counterparty(CounterpartyV3 counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -830,6 +913,7 @@ public CounterpartyV3 getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(CounterpartyV3 counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -842,6 +926,7 @@ public void setCounterparty(CounterpartyV3 counterparty) { */ public Transfer createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -869,6 +954,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -883,6 +969,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { @Deprecated // deprecated since Transfers API v3: Use createdAt or updatedAt public Transfer creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -914,6 +1001,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -932,6 +1020,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Transfer description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -971,6 +1060,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -981,6 +1071,7 @@ public void setDescription(String description) { */ public Transfer directDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set return this; } @@ -1004,6 +1095,7 @@ public DirectDebitInformation getDirectDebitInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set } /** @@ -1014,6 +1106,7 @@ public void setDirectDebitInformation(DirectDebitInformation directDebitInformat */ public Transfer direction(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -1037,6 +1130,7 @@ public DirectionEnum getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -1047,6 +1141,7 @@ public void setDirection(DirectionEnum direction) { */ public Transfer executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -1070,6 +1165,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -1080,6 +1176,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public Transfer id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -1103,6 +1200,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -1113,6 +1211,7 @@ public void setId(String id) { */ public Transfer paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -1136,6 +1235,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -1146,6 +1246,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public Transfer reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -1169,6 +1270,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -1181,6 +1283,7 @@ public void setReason(ReasonEnum reason) { */ public Transfer reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1208,6 +1311,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1226,6 +1330,7 @@ public void setReference(String reference) { */ public Transfer referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -1265,6 +1370,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -1275,6 +1381,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public Transfer review(TransferReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1298,39 +1405,51 @@ public TransferReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferReview review) { this.review = review; + isSetReview = true; // mark as set } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * @return the current {@code Transfer} instance, allowing for method chaining */ public Transfer status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @return status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1340,21 +1459,27 @@ public StatusEnum getStatus() { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -1367,6 +1492,7 @@ public void setStatus(StatusEnum status) { */ public Transfer type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1394,6 +1520,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Transfer includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Transfer object is equal to o. */ @@ -1495,6 +1642,87 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDirectDebitInformation) { + addIfNull(nulls, JSON_PROPERTY_DIRECT_DEBIT_INFORMATION, this.directDebitInformation); + } + if (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetExecutionDate) { + addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetReview) { + addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Transfer given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferData.java b/src/main/java/com/adyen/model/transfers/TransferData.java index 684370fbb..5d549af2e 100644 --- a/src/main/java/com/adyen/model/transfers/TransferData.java +++ b/src/main/java/com/adyen/model/transfers/TransferData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -60,27 +62,42 @@ public class TransferData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. */ public enum CategoryEnum { BANK(String.valueOf("bank")), @@ -133,25 +150,46 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private TransferNotificationCounterParty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; @Deprecated // deprecated since Transfers API v3: Use createdAt or updatedAt private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_DIRECT_DEBIT_INFORMATION = "directDebitInformation"; private DirectDebitInformation directDebitInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectDebitInformation = false; + /** The direction of the transfer. Possible values: **incoming**, **outgoing**. */ public enum DirectionEnum { INCOMING(String.valueOf("incoming")), @@ -196,24 +234,45 @@ public static DirectionEnum fromValue(String value) { public static final String JSON_PROPERTY_DIRECTION = "direction"; private DirectionEnum direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_EVENT_ID = "eventId"; private String eventId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventId = false; + public static final String JSON_PROPERTY_EVENTS = "events"; private List events; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEvents = false; + public static final String JSON_PROPERTY_EXECUTION_DATE = "executionDate"; private ExecutionDate executionDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecutionDate = false; + public static final String JSON_PROPERTY_EXTERNAL_REASON = "externalReason"; private ExternalReason externalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalReason = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + /** Additional information about the status of the transfer. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -263,6 +322,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -305,24 +366,41 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_REVIEW = "review"; private TransferReview review; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReview = false; + public static final String JSON_PROPERTY_SEQUENCE_NUMBER = "sequenceNumber"; private Integer sequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceNumber = false; + /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -497,12 +575,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TRACKING = "tracking"; private TransferDataTracking tracking; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTracking = false; + public static final String JSON_PROPERTY_TRANSACTION_RULES_RESULT = "transactionRulesResult"; private TransactionRulesResult transactionRulesResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRulesResult = false; + /** * The type of transfer or transaction. For example, **refund**, **payment**, * **internalTransfer**, **bankTransfer**. @@ -622,9 +709,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; private OffsetDateTime updatedAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdatedAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferData() {} /** @@ -635,6 +734,7 @@ public TransferData() {} */ public TransferData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -658,6 +758,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -668,6 +769,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public TransferData amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -691,6 +793,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -701,6 +804,7 @@ public void setAmount(Amount amount) { */ public TransferData balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -724,6 +828,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -734,6 +839,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public TransferData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -757,6 +863,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -767,6 +874,7 @@ public void setBalancePlatform(String balancePlatform) { */ public TransferData balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -798,53 +906,55 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @return category The category of the transfer. Possible values: - **bank**: a transfer + * @return category The category of the transfer. Possible values: - **bank**: A transfer * involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -853,29 +963,30 @@ public CategoryEnum getCategory() { } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -886,6 +997,7 @@ public void setCategory(CategoryEnum category) { */ public TransferData categoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -909,6 +1021,7 @@ public TransferCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -919,6 +1032,7 @@ public void setCategoryData(TransferCategoryData categoryData) { */ public TransferData counterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -942,6 +1056,7 @@ public TransferNotificationCounterParty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -954,6 +1069,7 @@ public void setCounterparty(TransferNotificationCounterParty counterparty) { */ public TransferData createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -981,6 +1097,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -995,6 +1112,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { @Deprecated // deprecated since Transfers API v3: Use createdAt or updatedAt public TransferData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -1026,6 +1144,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -1044,6 +1163,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public TransferData description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -1083,6 +1203,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -1093,6 +1214,7 @@ public void setDescription(String description) { */ public TransferData directDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set return this; } @@ -1116,6 +1238,7 @@ public DirectDebitInformation getDirectDebitInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set } /** @@ -1126,6 +1249,7 @@ public void setDirectDebitInformation(DirectDebitInformation directDebitInformat */ public TransferData direction(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -1149,6 +1273,7 @@ public DirectionEnum getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -1161,6 +1286,7 @@ public void setDirection(DirectionEnum direction) { */ public TransferData eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -1188,6 +1314,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -1198,6 +1325,7 @@ public void setEventId(String eventId) { */ public TransferData events(List events) { this.events = events; + isSetEvents = true; // mark as set return this; } @@ -1229,6 +1357,7 @@ public List getEvents() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEvents(List events) { this.events = events; + isSetEvents = true; // mark as set } /** @@ -1239,6 +1368,7 @@ public void setEvents(List events) { */ public TransferData executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -1262,6 +1392,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -1272,6 +1403,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public TransferData externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -1295,6 +1427,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -1305,6 +1438,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -1328,6 +1462,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -1338,6 +1473,7 @@ public void setId(String id) { */ public TransferData paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -1361,6 +1497,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -1371,6 +1508,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public TransferData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -1394,6 +1532,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -1406,6 +1545,7 @@ public void setReason(ReasonEnum reason) { */ public TransferData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1433,6 +1573,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1451,6 +1592,7 @@ public void setReference(String reference) { */ public TransferData referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -1490,6 +1632,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -1500,6 +1643,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public TransferData review(TransferReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1523,6 +1667,7 @@ public TransferReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferReview review) { this.review = review; + isSetReview = true; // mark as set } /** @@ -1537,6 +1682,7 @@ public void setReview(TransferReview review) { */ public TransferData sequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set return this; } @@ -1568,39 +1714,51 @@ public Integer getSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @return status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1610,21 +1768,27 @@ public StatusEnum getStatus() { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -1635,6 +1799,7 @@ public void setStatus(StatusEnum status) { */ public TransferData tracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set return this; } @@ -1658,6 +1823,7 @@ public TransferDataTracking getTracking() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set } /** @@ -1668,6 +1834,7 @@ public void setTracking(TransferDataTracking tracking) { */ public TransferData transactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set return this; } @@ -1691,6 +1858,7 @@ public TransactionRulesResult getTransactionRulesResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set } /** @@ -1703,6 +1871,7 @@ public void setTransactionRulesResult(TransactionRulesResult transactionRulesRes */ public TransferData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1730,6 +1899,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1742,6 +1912,7 @@ public void setType(TypeEnum type) { */ public TransferData updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set return this; } @@ -1769,6 +1940,27 @@ public OffsetDateTime getUpdatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferData object is equal to o. */ @@ -1899,6 +2091,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDirectDebitInformation) { + addIfNull(nulls, JSON_PROPERTY_DIRECT_DEBIT_INFORMATION, this.directDebitInformation); + } + if (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetEventId) { + addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); + } + if (isSetEvents) { + addIfNull(nulls, JSON_PROPERTY_EVENTS, this.events); + } + if (isSetExecutionDate) { + addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); + } + if (isSetExternalReason) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetReview) { + addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); + } + if (isSetSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_NUMBER, this.sequenceNumber); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTracking) { + addIfNull(nulls, JSON_PROPERTY_TRACKING, this.tracking); + } + if (isSetTransactionRulesResult) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULES_RESULT, this.transactionRulesResult); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdatedAt) { + addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferEvent.java b/src/main/java/com/adyen/model/transfers/TransferEvent.java index cfba03bb6..3c4ec635e 100644 --- a/src/main/java/com/adyen/model/transfers/TransferEvent.java +++ b/src/main/java/com/adyen/model/transfers/TransferEvent.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -49,36 +51,69 @@ public class TransferEvent { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENTS = "amountAdjustments"; private List amountAdjustments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustments = false; + public static final String JSON_PROPERTY_ARN = "arn"; private String arn; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArn = false; + public static final String JSON_PROPERTY_BOOKING_DATE = "bookingDate"; private OffsetDateTime bookingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBookingDate = false; + public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + public static final String JSON_PROPERTY_EVENTS_DATA = "eventsData"; private List eventsData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventsData = false; + public static final String JSON_PROPERTY_EXTERNAL_REASON = "externalReason"; private ExternalReason externalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalReason = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MODIFICATION = "modification"; private Modification modification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModification = false; + public static final String JSON_PROPERTY_MUTATIONS = "mutations"; private List mutations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMutations = false; + public static final String JSON_PROPERTY_ORIGINAL_AMOUNT = "originalAmount"; private Amount originalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalAmount = false; + /** The reason for the transfer status. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -128,6 +163,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -170,6 +207,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** The status of the transfer event. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -344,12 +384,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TRACKING_DATA = "trackingData"; private TransferEventTrackingData trackingData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackingData = false; + public static final String JSON_PROPERTY_TRANSACTION_ID = "transactionId"; private String transactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionId = false; + /** The type of the transfer event. Possible values: **accounting**, **tracking**. */ public enum TypeEnum { ACCOUNTING(String.valueOf("accounting")), @@ -394,12 +443,27 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_UPDATE_DATE = "updateDate"; private OffsetDateTime updateDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdateDate = false; + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; private OffsetDateTime valueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferEvent() {} /** @@ -410,6 +474,7 @@ public TransferEvent() {} */ public TransferEvent amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -433,6 +498,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -445,6 +511,7 @@ public void setAmount(Amount amount) { */ public TransferEvent amountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set return this; } @@ -480,6 +547,7 @@ public List getAmountAdjustments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set } /** @@ -490,6 +558,7 @@ public void setAmountAdjustments(List amountAdjustments) { */ public TransferEvent arn(String arn) { this.arn = arn; + isSetArn = true; // mark as set return this; } @@ -514,6 +583,7 @@ public String getArn() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArn(String arn) { this.arn = arn; + isSetArn = true; // mark as set } /** @@ -524,6 +594,7 @@ public void setArn(String arn) { */ public TransferEvent bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set return this; } @@ -547,6 +618,7 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set } /** @@ -558,6 +630,7 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public TransferEvent estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -583,6 +656,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -593,6 +667,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public TransferEvent eventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set return this; } @@ -624,6 +699,7 @@ public List getEventsData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set } /** @@ -634,6 +710,7 @@ public void setEventsData(List eventsData) { */ public TransferEvent externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -657,6 +734,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -667,6 +745,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferEvent id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -690,6 +769,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -700,6 +780,7 @@ public void setId(String id) { */ public TransferEvent modification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set return this; } @@ -723,6 +804,7 @@ public Modification getModification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set } /** @@ -733,6 +815,7 @@ public void setModification(Modification modification) { */ public TransferEvent mutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set return this; } @@ -764,6 +847,7 @@ public List getMutations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set } /** @@ -774,6 +858,7 @@ public void setMutations(List mutations) { */ public TransferEvent originalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set return this; } @@ -797,6 +882,7 @@ public Amount getOriginalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set } /** @@ -807,6 +893,7 @@ public void setOriginalAmount(Amount originalAmount) { */ public TransferEvent reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -830,6 +917,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -840,6 +928,7 @@ public void setReason(ReasonEnum reason) { */ public TransferEvent status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -863,6 +952,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -873,6 +963,7 @@ public void setStatus(StatusEnum status) { */ public TransferEvent trackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set return this; } @@ -896,6 +987,7 @@ public TransferEventTrackingData getTrackingData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set } /** @@ -908,6 +1000,7 @@ public void setTrackingData(TransferEventTrackingData trackingData) { */ public TransferEvent transactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set return this; } @@ -935,6 +1028,7 @@ public String getTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set } /** @@ -945,6 +1039,7 @@ public void setTransactionId(String transactionId) { */ public TransferEvent type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -968,6 +1063,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -978,6 +1074,7 @@ public void setType(TypeEnum type) { */ public TransferEvent updateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set return this; } @@ -1001,6 +1098,7 @@ public OffsetDateTime getUpdateDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set } /** @@ -1013,6 +1111,7 @@ public void setUpdateDate(OffsetDateTime updateDate) { */ public TransferEvent valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set return this; } @@ -1040,6 +1139,27 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferEvent includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferEvent object is equal to o. */ @@ -1133,6 +1253,81 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustments) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENTS, this.amountAdjustments); + } + if (isSetArn) { + addIfNull(nulls, JSON_PROPERTY_ARN, this.arn); + } + if (isSetBookingDate) { + addIfNull(nulls, JSON_PROPERTY_BOOKING_DATE, this.bookingDate); + } + if (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + if (isSetEventsData) { + addIfNull(nulls, JSON_PROPERTY_EVENTS_DATA, this.eventsData); + } + if (isSetExternalReason) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetModification) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION, this.modification); + } + if (isSetMutations) { + addIfNull(nulls, JSON_PROPERTY_MUTATIONS, this.mutations); + } + if (isSetOriginalAmount) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_AMOUNT, this.originalAmount); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTrackingData) { + addIfNull(nulls, JSON_PROPERTY_TRACKING_DATA, this.trackingData); + } + if (isSetTransactionId) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_ID, this.transactionId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdateDate) { + addIfNull(nulls, JSON_PROPERTY_UPDATE_DATE, this.updateDate); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferEvent given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferInfo.java b/src/main/java/com/adyen/model/transfers/TransferInfo.java index a47ba7813..5f2a3e7c0 100644 --- a/src/main/java/com/adyen/model/transfers/TransferInfo.java +++ b/src/main/java/com/adyen/model/transfers/TransferInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -44,18 +46,24 @@ public class TransferInfo { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. */ public enum CategoryEnum { BANK(String.valueOf("bank")), @@ -108,18 +116,33 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private CounterpartyInfoV3 counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_EXECUTION_DATE = "executionDate"; private ExecutionDate executionDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecutionDate = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -172,17 +195,20 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ public enum PriorityEnum { @@ -236,15 +262,27 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_REVIEW = "review"; private TransferRequestReview review; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReview = false; + /** * The type of transfer. Possible values: - **bankTransfer**: for push transfers to a transfer * instrument or a bank account. The `category` must be **bank**. - @@ -297,9 +335,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_ULTIMATE_PARTY = "ultimateParty"; private UltimatePartyIdentification ultimateParty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUltimateParty = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferInfo() {} /** @@ -310,6 +360,7 @@ public TransferInfo() {} */ public TransferInfo amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -333,6 +384,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -356,6 +408,7 @@ public void setAmount(Amount amount) { */ public TransferInfo balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -405,53 +458,55 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. * @return the current {@code TransferInfo} instance, allowing for method chaining */ public TransferInfo category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @return category The category of the transfer. Possible values: - **bank**: a transfer + * @return category The category of the transfer. Possible values: - **bank**: A transfer * involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -460,29 +515,30 @@ public CategoryEnum getCategory() { } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -493,6 +549,7 @@ public void setCategory(CategoryEnum category) { */ public TransferInfo counterparty(CounterpartyInfoV3 counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -516,6 +573,7 @@ public CounterpartyInfoV3 getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(CounterpartyInfoV3 counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -534,6 +592,7 @@ public void setCounterparty(CounterpartyInfoV3 counterparty) { */ public TransferInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -573,6 +632,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -583,6 +643,7 @@ public void setDescription(String description) { */ public TransferInfo executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -606,6 +667,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -626,6 +688,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public TransferInfo paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -669,20 +732,21 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** * The list of priorities for the bank transfer. This sets the speed at which the transfer is sent * and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay * out using the priority you list first. If that's not possible, it moves on to the next - * option in the order of your provided priorities. Possible values: * **regular**: for normal, - * low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. - * Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer + * option in the order of your provided priorities. Possible values: * **regular**: For normal, + * low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. + * Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer * funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * - * **instant**: for instant funds transfers within the United States and in [SEPA + * **instant**: For instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Required for transfers with `category` **bank**. For more details, see * [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -691,14 +755,14 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { * the transfer is sent and the fees that you have to pay. You can provide multiple * priorities. Adyen will try to pay out using the priority you list first. If that's not * possible, it moves on to the next option in the order of your provided priorities. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Required for transfers with `category` **bank**. For more details, * see [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -706,6 +770,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public TransferInfo priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -721,14 +786,14 @@ public TransferInfo addPrioritiesItem(PrioritiesEnum prioritiesItem) { * The list of priorities for the bank transfer. This sets the speed at which the transfer is sent * and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay * out using the priority you list first. If that's not possible, it moves on to the next - * option in the order of your provided priorities. Possible values: * **regular**: for normal, - * low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. - * Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer + * option in the order of your provided priorities. Possible values: * **regular**: For normal, + * low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. + * Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer * funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * - * **instant**: for instant funds transfers within the United States and in [SEPA + * **instant**: For instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Required for transfers with `category` **bank**. For more details, see * [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -737,14 +802,14 @@ public TransferInfo addPrioritiesItem(PrioritiesEnum prioritiesItem) { * the transfer is sent and the fees that you have to pay. You can provide multiple * priorities. Adyen will try to pay out using the priority you list first. If that's not * possible, it moves on to the next option in the order of your provided priorities. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Required for transfers with `category` **bank**. For more details, * see [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -759,14 +824,14 @@ public List getPriorities() { * The list of priorities for the bank transfer. This sets the speed at which the transfer is sent * and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay * out using the priority you list first. If that's not possible, it moves on to the next - * option in the order of your provided priorities. Possible values: * **regular**: for normal, - * low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. - * Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer + * option in the order of your provided priorities. Possible values: * **regular**: For normal, + * low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. + * Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer * funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * - * **instant**: for instant funds transfers within the United States and in [SEPA + * **instant**: For instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Required for transfers with `category` **bank**. For more details, see * [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -775,14 +840,14 @@ public List getPriorities() { * the transfer is sent and the fees that you have to pay. You can provide multiple * priorities. Adyen will try to pay out using the priority you list first. If that's not * possible, it moves on to the next option in the order of your provided priorities. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Required for transfers with `category` **bank**. For more details, * see [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -791,62 +856,64 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * @return the current {@code TransferInfo} instance, allowing for method chaining */ public TransferInfo priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @return priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @@ -858,32 +925,33 @@ public PriorityEnum getPriority() { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -896,6 +964,7 @@ public void setPriority(PriorityEnum priority) { */ public TransferInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -923,6 +992,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -942,6 +1012,7 @@ public void setReference(String reference) { */ public TransferInfo referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -983,6 +1054,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -993,6 +1065,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public TransferInfo review(TransferRequestReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1016,6 +1089,7 @@ public TransferRequestReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferRequestReview review) { this.review = review; + isSetReview = true; // mark as set } /** @@ -1034,6 +1108,7 @@ public void setReview(TransferRequestReview review) { */ public TransferInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1073,6 +1148,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1083,6 +1159,7 @@ public void setType(TypeEnum type) { */ public TransferInfo ultimateParty(UltimatePartyIdentification ultimateParty) { this.ultimateParty = ultimateParty; + isSetUltimateParty = true; // mark as set return this; } @@ -1106,6 +1183,27 @@ public UltimatePartyIdentification getUltimateParty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUltimateParty(UltimatePartyIdentification ultimateParty) { this.ultimateParty = ultimateParty; + isSetUltimateParty = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferInfo object is equal to o. */ @@ -1189,6 +1287,69 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetExecutionDate) { + addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetReview) { + addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUltimateParty) { + addIfNull(nulls, JSON_PROPERTY_ULTIMATE_PARTY, this.ultimateParty); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java b/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java index f2baaae5d..ca94ac8ce 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class TransferNotificationCounterParty { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_MERCHANT = "merchant"; private TransferNotificationMerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationCounterParty() {} /** @@ -54,6 +77,7 @@ public TransferNotificationCounterParty() {} */ public TransferNotificationCounterParty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -92,6 +117,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public TransferNotificationCounterParty bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -115,6 +141,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -126,6 +153,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public TransferNotificationCounterParty card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -149,6 +177,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -160,6 +189,7 @@ public void setCard(Card card) { */ public TransferNotificationCounterParty merchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -183,6 +213,7 @@ public TransferNotificationMerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -196,6 +227,7 @@ public void setMerchant(TransferNotificationMerchantData merchant) { */ public TransferNotificationCounterParty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -223,6 +255,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationCounterParty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationCounterParty object is equal to o. */ @@ -274,6 +327,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationCounterParty given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java b/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java index e2df93fe4..1858c7eae 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,24 +33,51 @@ public class TransferNotificationMerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationMerchantData() {} /** @@ -60,6 +89,7 @@ public TransferNotificationMerchantData() {} */ public TransferNotificationMerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -83,6 +113,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -94,6 +125,7 @@ public void setAcquirerId(String acquirerId) { */ public TransferNotificationMerchantData city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -117,6 +149,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -128,6 +161,7 @@ public void setCity(String city) { */ public TransferNotificationMerchantData country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -151,6 +185,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -162,6 +197,7 @@ public void setCountry(String country) { */ public TransferNotificationMerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -185,6 +221,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -196,6 +233,7 @@ public void setMcc(String mcc) { */ public TransferNotificationMerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -219,6 +257,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -230,6 +269,7 @@ public void setMerchantId(String merchantId) { */ public TransferNotificationMerchantData name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -253,6 +293,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -264,6 +305,7 @@ public void setName(String name) { */ public TransferNotificationMerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -287,6 +329,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationMerchantData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationMerchantData object is equal to o. */ @@ -339,6 +402,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationMerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java index 39470d60c..3e2b75497 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TransferNotificationValidationFact { public static final String JSON_PROPERTY_RESULT = "result"; private String result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationValidationFact() {} /** @@ -40,6 +54,7 @@ public TransferNotificationValidationFact() {} */ public TransferNotificationValidationFact result(String result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setResult(String result) { */ public TransferNotificationValidationFact type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationValidationFact includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationValidationFact object is equal to o. */ @@ -139,6 +177,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationValidationFact given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferRequestReview.java b/src/main/java/com/adyen/model/transfers/TransferRequestReview.java index dc0e34813..db44f425e 100644 --- a/src/main/java/com/adyen/model/transfers/TransferRequestReview.java +++ b/src/main/java/com/adyen/model/transfers/TransferRequestReview.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,9 +29,21 @@ public class TransferRequestReview { "numberOfApprovalsRequired"; private Integer numberOfApprovalsRequired; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfApprovalsRequired = false; + public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private Boolean scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferRequestReview() {} /** @@ -44,6 +58,7 @@ public TransferRequestReview() {} */ public TransferRequestReview numberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set return this; } @@ -75,6 +90,7 @@ public Integer getNumberOfApprovalsRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set } /** @@ -92,6 +108,7 @@ public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { */ public TransferRequestReview scaOnApproval(Boolean scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -129,6 +146,27 @@ public Boolean getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(Boolean scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferRequestReview includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferRequestReview object is equal to o. */ @@ -173,6 +211,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNumberOfApprovalsRequired) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_APPROVALS_REQUIRED, this.numberOfApprovalsRequired); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferRequestReview given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferReview.java b/src/main/java/com/adyen/model/transfers/TransferReview.java index 686389247..8000590c4 100644 --- a/src/main/java/com/adyen/model/transfers/TransferReview.java +++ b/src/main/java/com/adyen/model/transfers/TransferReview.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class TransferReview { "numberOfApprovalsRequired"; private Integer numberOfApprovalsRequired; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfApprovalsRequired = false; + /** * Shows the status of the Strong Customer Authentication (SCA) process. Possible values: * **required**, **notApplicable**. @@ -80,6 +85,15 @@ public static ScaOnApprovalEnum fromValue(String value) { public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private ScaOnApprovalEnum scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferReview() {} /** @@ -94,6 +108,7 @@ public TransferReview() {} */ public TransferReview numberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set return this; } @@ -125,6 +140,7 @@ public Integer getNumberOfApprovalsRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set } /** @@ -137,6 +153,7 @@ public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { */ public TransferReview scaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -164,6 +181,27 @@ public ScaOnApprovalEnum getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferReview includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferReview object is equal to o. */ @@ -207,6 +245,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNumberOfApprovalsRequired) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_APPROVALS_REQUIRED, this.numberOfApprovalsRequired); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferReview given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java b/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java index 5a9123bab..85fea0eb8 100644 --- a/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java +++ b/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,33 +38,69 @@ public class TransferServiceRestServiceError { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + public static final String JSON_PROPERTY_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_RESPONSE = "response"; private Object response; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + public static final String JSON_PROPERTY_ROUTING_DETAILS = "routingDetails"; private List routingDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingDetails = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferServiceRestServiceError() {} /** @@ -74,6 +112,7 @@ public TransferServiceRestServiceError() {} */ public TransferServiceRestServiceError detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -97,6 +136,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -108,6 +148,7 @@ public void setDetail(String detail) { */ public TransferServiceRestServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -131,6 +172,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -142,6 +184,7 @@ public void setErrorCode(String errorCode) { */ public TransferServiceRestServiceError instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -165,6 +208,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -176,6 +220,7 @@ public void setInstance(String instance) { */ public TransferServiceRestServiceError invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -207,6 +252,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -219,6 +265,7 @@ public void setInvalidFields(List invalidFields) { */ public TransferServiceRestServiceError requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -244,6 +291,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -255,6 +303,7 @@ public void setRequestId(String requestId) { */ public TransferServiceRestServiceError response(Object response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -278,6 +327,7 @@ public Object getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(Object response) { this.response = response; + isSetResponse = true; // mark as set } /** @@ -291,6 +341,7 @@ public void setResponse(Object response) { */ public TransferServiceRestServiceError routingDetails(List routingDetails) { this.routingDetails = routingDetails; + isSetRoutingDetails = true; // mark as set return this; } @@ -326,6 +377,7 @@ public List getRoutingDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingDetails(List routingDetails) { this.routingDetails = routingDetails; + isSetRoutingDetails = true; // mark as set } /** @@ -337,6 +389,7 @@ public void setRoutingDetails(List routingDetails) { */ public TransferServiceRestServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -360,6 +413,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -371,6 +425,7 @@ public void setStatus(Integer status) { */ public TransferServiceRestServiceError title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -394,6 +449,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -407,6 +463,7 @@ public void setTitle(String title) { */ public TransferServiceRestServiceError type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -434,6 +491,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferServiceRestServiceError includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferServiceRestServiceError object is equal to o. */ @@ -502,6 +580,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetRoutingDetails) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_DETAILS, this.routingDetails); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferServiceRestServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferView.java b/src/main/java/com/adyen/model/transfers/TransferView.java index 14b147cea..455b36890 100644 --- a/src/main/java/com/adyen/model/transfers/TransferView.java +++ b/src/main/java/com/adyen/model/transfers/TransferView.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class TransferView { public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferView() {} /** @@ -43,6 +60,7 @@ public TransferView() {} */ public TransferView categoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -66,6 +84,7 @@ public TransferCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCategoryData(TransferCategoryData categoryData) { */ public TransferView id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setId(String id) { */ public TransferView reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -150,6 +172,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferView includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferView object is equal to o. */ @@ -193,6 +236,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferView given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java index 6da2ae26f..60cfad17e 100644 --- a/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class UKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + /** **ukLocal** */ public enum TypeEnum { UKLOCAL(String.valueOf("ukLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UKLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java index 0753bffab..b8e432d75 100644 --- a/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class USLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -78,9 +83,15 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + /** **usLocal** */ public enum TypeEnum { USLOCAL(String.valueOf("usLocal")); @@ -123,6 +134,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public USLocalAccountIdentification() {} /** @@ -133,6 +153,7 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -156,6 +177,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +189,7 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -192,6 +215,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -205,6 +229,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -234,6 +259,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -244,6 +270,7 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -267,6 +294,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public USLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this USLocalAccountIdentification object is equal to o. */ @@ -312,6 +360,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of USLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java index 1b8cbaeee..eb9b15392 100644 --- a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java +++ b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,6 +31,7 @@ UltimatePartyIdentification.JSON_PROPERTY_EMAIL, UltimatePartyIdentification.JSON_PROPERTY_FIRST_NAME, UltimatePartyIdentification.JSON_PROPERTY_FULL_NAME, + UltimatePartyIdentification.JSON_PROPERTY_FUNDING_INSTRUMENT, UltimatePartyIdentification.JSON_PROPERTY_LAST_NAME, UltimatePartyIdentification.JSON_PROPERTY_REFERENCE, UltimatePartyIdentification.JSON_PROPERTY_TYPE, @@ -38,24 +41,51 @@ public class UltimatePartyIdentification { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = false; + + public static final String JSON_PROPERTY_FUNDING_INSTRUMENT = "fundingInstrument"; + private FundingInstrument fundingInstrument; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingInstrument = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The type of entity that owns the bank account or card. Possible values: **individual**, * **organization**, or **unknown**. Required when `category` is **card**. In this case, @@ -106,9 +136,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UltimatePartyIdentification() {} /** @@ -119,6 +161,7 @@ public UltimatePartyIdentification() {} */ public UltimatePartyIdentification address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -142,6 +185,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -155,6 +199,7 @@ public void setAddress(Address address) { */ public UltimatePartyIdentification dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -184,6 +229,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -195,6 +241,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public UltimatePartyIdentification email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -220,6 +267,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -234,6 +282,7 @@ public void setEmail(String email) { */ public UltimatePartyIdentification firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -265,6 +314,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -279,6 +329,7 @@ public void setFirstName(String firstName) { */ public UltimatePartyIdentification fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -310,6 +361,42 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set + } + + /** + * fundingInstrument + * + * @param fundingInstrument + * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining + */ + public UltimatePartyIdentification fundingInstrument(FundingInstrument fundingInstrument) { + this.fundingInstrument = fundingInstrument; + isSetFundingInstrument = true; // mark as set + return this; + } + + /** + * Get fundingInstrument + * + * @return fundingInstrument + */ + @JsonProperty(JSON_PROPERTY_FUNDING_INSTRUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FundingInstrument getFundingInstrument() { + return fundingInstrument; + } + + /** + * fundingInstrument + * + * @param fundingInstrument + */ + @JsonProperty(JSON_PROPERTY_FUNDING_INSTRUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFundingInstrument(FundingInstrument fundingInstrument) { + this.fundingInstrument = fundingInstrument; + isSetFundingInstrument = true; // mark as set } /** @@ -324,6 +411,7 @@ public void setFullName(String fullName) { */ public UltimatePartyIdentification lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -355,6 +443,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -369,6 +458,7 @@ public void setLastName(String lastName) { */ public UltimatePartyIdentification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -400,6 +490,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -414,6 +505,7 @@ public void setReference(String reference) { */ public UltimatePartyIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -445,6 +537,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -455,6 +548,7 @@ public void setType(TypeEnum type) { */ public UltimatePartyIdentification url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -478,6 +572,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UltimatePartyIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UltimatePartyIdentification object is equal to o. */ @@ -495,6 +610,7 @@ public boolean equals(Object o) { && Objects.equals(this.email, ultimatePartyIdentification.email) && Objects.equals(this.firstName, ultimatePartyIdentification.firstName) && Objects.equals(this.fullName, ultimatePartyIdentification.fullName) + && Objects.equals(this.fundingInstrument, ultimatePartyIdentification.fundingInstrument) && Objects.equals(this.lastName, ultimatePartyIdentification.lastName) && Objects.equals(this.reference, ultimatePartyIdentification.reference) && Objects.equals(this.type, ultimatePartyIdentification.type) @@ -504,7 +620,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - address, dateOfBirth, email, firstName, fullName, lastName, reference, type, url); + address, + dateOfBirth, + email, + firstName, + fullName, + fundingInstrument, + lastName, + reference, + type, + url); } @Override @@ -516,6 +641,7 @@ public String toString() { sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" fundingInstrument: ").append(toIndentedString(fundingInstrument)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); @@ -534,6 +660,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetFundingInstrument) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_INSTRUMENT, this.fundingInstrument); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UltimatePartyIdentification given an JSON string * From 2275c10155df49d27ff9082ef2ae2db3a8fc32df Mon Sep 17 00:00:00 2001 From: gcatanese Date: Fri, 5 Dec 2025 15:06:58 +0100 Subject: [PATCH 2/4] Generate Transfer Webhooks models --- .../AULocalAccountIdentification.java | 73 +++ .../AdditionalBankIdentification.java | 65 +++ .../adyen/model/transferwebhooks/Address.java | 97 ++++ .../adyen/model/transferwebhooks/Airline.java | 65 +++ .../adyen/model/transferwebhooks/Amount.java | 95 +++- .../transferwebhooks/AmountAdjustment.java | 73 +++ .../BRLocalAccountIdentification.java | 89 ++++ .../transferwebhooks/BalanceMutation.java | 81 ++++ .../BalancePlatformNotificationResponse.java | 57 +++ .../model/transferwebhooks/BankAccountV3.java | 126 ++++- .../transferwebhooks/BankCategoryData.java | 135 ++++-- .../CALocalAccountIdentification.java | 89 ++++ .../CZLocalAccountIdentification.java | 73 +++ .../adyen/model/transferwebhooks/Card.java | 65 +++ .../transferwebhooks/CardIdentification.java | 105 ++++ .../ConfirmationTrackingData.java | 65 +++ .../transferwebhooks/CounterpartyV3.java | 89 ++++ .../DKLocalAccountIdentification.java | 73 +++ .../DirectDebitInformation.java | 81 ++++ .../EstimationTrackingData.java | 65 +++ .../model/transferwebhooks/ExecutionDate.java | 65 +++ .../transferwebhooks/ExternalReason.java | 73 +++ .../HKLocalAccountIdentification.java | 73 +++ .../HULocalAccountIdentification.java | 65 +++ .../IbanAccountIdentification.java | 65 +++ .../InternalCategoryData.java | 74 +++ .../InternalReviewTrackingData.java | 73 +++ .../model/transferwebhooks/IssuedCard.java | 121 +++++ .../IssuingTransactionData.java | 65 +++ .../com/adyen/model/transferwebhooks/Leg.java | 97 ++++ .../adyen/model/transferwebhooks/Lodging.java | 65 +++ .../model/transferwebhooks/MerchantData.java | 89 ++++ .../MerchantPurchaseData.java | 73 +++ .../model/transferwebhooks/Modification.java | 89 ++++ .../NOLocalAccountIdentification.java | 65 +++ .../NZLocalAccountIdentification.java | 65 +++ .../model/transferwebhooks/NameLocation.java | 97 ++++ .../NumberAndBicAccountIdentification.java | 82 ++++ .../PLLocalAccountIdentification.java | 65 +++ .../transferwebhooks/PartyIdentification.java | 121 +++++ .../transferwebhooks/PaymentInstrument.java | 81 ++++ .../transferwebhooks/PlatformPayment.java | 280 +++++++---- .../RelayedAuthorisationData.java | 65 +++ .../model/transferwebhooks/Resource.java | 73 +++ .../transferwebhooks/ResourceReference.java | 73 +++ .../SELocalAccountIdentification.java | 73 +++ .../SGLocalAccountIdentification.java | 73 +++ .../model/transferwebhooks/ThreeDSecure.java | 57 +++ .../TransactionEventViolation.java | 73 +++ .../TransactionRuleReference.java | 89 ++++ .../TransactionRuleSource.java | 65 +++ .../TransactionRulesResult.java | 81 ++++ .../model/transferwebhooks/TransferData.java | 454 +++++++++++++++--- .../model/transferwebhooks/TransferEvent.java | 195 ++++++++ .../TransferNotificationCounterParty.java | 89 ++++ .../TransferNotificationMerchantData.java | 105 ++++ .../TransferNotificationRequest.java | 81 ++++ .../TransferNotificationValidationFact.java | 65 +++ .../transferwebhooks/TransferReview.java | 65 +++ .../UKLocalAccountIdentification.java | 73 +++ .../USLocalAccountIdentification.java | 81 ++++ 61 files changed, 5316 insertions(+), 218 deletions(-) diff --git a/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java index 840af2718..89cc0a70a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class AULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; private String bsbCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + /** **auLocal** */ public enum TypeEnum { AULOCAL(String.valueOf("auLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AULocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AULocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java index 2cd17d0bb..4cde8b42e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class AdditionalBankIdentification { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + /** * The type of additional bank identification, depending on the country. Possible values: * * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) @@ -89,6 +94,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalBankIdentification() {} /** @@ -99,6 +113,7 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -122,6 +137,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -150,6 +166,7 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -209,6 +226,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalBankIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalBankIdentification object is equal to o. */ @@ -250,6 +288,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Address.java b/src/main/java/com/adyen/model/transferwebhooks/Address.java index d7ed7cc91..40b75cec1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Address.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Address { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Address() {} /** @@ -57,6 +83,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -95,6 +123,7 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -120,6 +149,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setCountry(String country) { */ public Address line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -175,6 +207,7 @@ public void setLine1(String line1) { */ public Address line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -204,6 +237,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -218,6 +252,7 @@ public void setLine2(String line2) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -249,6 +284,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -261,6 +297,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -288,6 +325,27 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Address includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Address object is equal to o. */ @@ -337,6 +395,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Address given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Airline.java b/src/main/java/com/adyen/model/transferwebhooks/Airline.java index bfe6ad80c..081cbcbcf 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Airline.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Airline.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,9 +27,21 @@ public class Airline { public static final String JSON_PROPERTY_LEGS = "legs"; private List legs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegs = false; + public static final String JSON_PROPERTY_TICKET_NUMBER = "ticketNumber"; private String ticketNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTicketNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Airline() {} /** @@ -38,6 +52,7 @@ public Airline() {} */ public Airline legs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set return this; } @@ -69,6 +84,7 @@ public List getLegs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setLegs(List legs) { */ public Airline ticketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set return this; } @@ -102,6 +119,27 @@ public String getTicketNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTicketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Airline includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Airline object is equal to o. */ @@ -143,6 +181,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLegs) { + addIfNull(nulls, JSON_PROPERTY_LEGS, this.legs); + } + if (isSetTicketNumber) { + addIfNull(nulls, JSON_PROPERTY_TICKET_NUMBER, this.ticketNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Airline given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Amount.java b/src/main/java/com/adyen/model/transferwebhooks/Amount.java index 63f056c5b..8ab4878a5 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,30 +25,47 @@ public class Amount { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Long value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * @return the current {@code Amount} instance, allowing for method chaining */ public Amount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @return currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,35 +75,39 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * @return the current {@code Amount} instance, allowing for method chaining */ public Amount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @return value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @@ -94,16 +117,37 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Amount object is equal to o. */ @@ -145,6 +189,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Amount given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java b/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java index 00fff8f3a..da40d7add 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class AmountAdjustment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The type of markup that is applied to an authorised payment. Possible values: **exchange**, * **forexMarkup**, **authHoldReserve**, **atmMarkup**. @@ -82,9 +87,21 @@ public static AmountAdjustmentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE = "amountAdjustmentType"; private AmountAdjustmentTypeEnum amountAdjustmentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustmentType = false; + public static final String JSON_PROPERTY_BASEPOINTS = "basepoints"; private Integer basepoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasepoints = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AmountAdjustment() {} /** @@ -95,6 +112,7 @@ public AmountAdjustment() {} */ public AmountAdjustment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -118,6 +136,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -130,6 +149,7 @@ public void setAmount(Amount amount) { */ public AmountAdjustment amountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set return this; } @@ -157,6 +177,7 @@ public AmountAdjustmentTypeEnum getAmountAdjustmentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set } /** @@ -167,6 +188,7 @@ public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentTyp */ public AmountAdjustment basepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set return this; } @@ -190,6 +212,27 @@ public Integer getBasepoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountAdjustment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AmountAdjustment object is equal to o. */ @@ -235,6 +278,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustmentType) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE, this.amountAdjustmentType); + } + if (isSetBasepoints) { + addIfNull(nulls, JSON_PROPERTY_BASEPOINTS, this.basepoints); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AmountAdjustment given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java index 12730df5f..9524de997 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class BRLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_ISPB = "ispb"; private String ispb; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIspb = false; + /** **brLocal** */ public enum TypeEnum { BRLOCAL(String.valueOf("brLocal")); @@ -84,6 +98,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BRLocalAccountIdentification() {} /** @@ -94,6 +117,7 @@ public BRLocalAccountIdentification() {} */ public BRLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAccountNumber(String accountNumber) { */ public BRLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setBankCode(String bankCode) { */ public BRLocalAccountIdentification branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -193,6 +222,7 @@ public void setBranchNumber(String branchNumber) { */ public BRLocalAccountIdentification ispb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set return this; } @@ -216,6 +246,7 @@ public String getIspb() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIspb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set } /** @@ -226,6 +257,7 @@ public void setIspb(String ispb) { */ public BRLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -249,6 +281,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BRLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BRLocalAccountIdentification object is equal to o. */ @@ -296,6 +349,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetIspb) { + addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BRLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java b/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java index a23e484bf..d87139c76 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class BalanceMutation { public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_RECEIVED = "received"; private Long received; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceived = false; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceMutation() {} /** @@ -49,6 +69,7 @@ public BalanceMutation() {} */ public BalanceMutation balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -76,6 +97,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -88,6 +110,7 @@ public void setBalance(Long balance) { */ public BalanceMutation currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -115,6 +138,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -127,6 +151,7 @@ public void setCurrency(String currency) { */ public BalanceMutation received(Long received) { this.received = received; + isSetReceived = true; // mark as set return this; } @@ -154,6 +179,7 @@ public Long getReceived() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceived(Long received) { this.received = received; + isSetReceived = true; // mark as set } /** @@ -166,6 +192,7 @@ public void setReceived(Long received) { */ public BalanceMutation reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -193,6 +220,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceMutation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceMutation object is equal to o. */ @@ -238,6 +286,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetReceived) { + addIfNull(nulls, JSON_PROPERTY_RECEIVED, this.received); + } + if (isSetReserved) { + addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceMutation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java index 6f13538f7..b42e64b6a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java index 5d6020d39..1b8c50b46 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -20,15 +22,34 @@ /** BankAccountV3 */ @JsonPropertyOrder({ BankAccountV3.JSON_PROPERTY_ACCOUNT_HOLDER, - BankAccountV3.JSON_PROPERTY_ACCOUNT_IDENTIFICATION + BankAccountV3.JSON_PROPERTY_ACCOUNT_IDENTIFICATION, + BankAccountV3.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID }) public class BankAccountV3 { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private PartyIdentification accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountV3AccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountV3() {} /** @@ -39,6 +60,7 @@ public BankAccountV3() {} */ public BankAccountV3 accountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -62,6 +84,7 @@ public PartyIdentification getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -73,6 +96,7 @@ public void setAccountHolder(PartyIdentification accountHolder) { public BankAccountV3 accountIdentification( BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -96,6 +120,68 @@ public BankAccountV3AccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @param storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + * @return the current {@code BankAccountV3} instance, allowing for method chaining + */ + public BankAccountV3 storedPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + return this; + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @return storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredPaymentMethodId() { + return storedPaymentMethodId; + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @param storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountV3 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankAccountV3 object is equal to o. */ @@ -109,12 +195,13 @@ public boolean equals(Object o) { } BankAccountV3 bankAccountV3 = (BankAccountV3) o; return Objects.equals(this.accountHolder, bankAccountV3.accountHolder) - && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification); + && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification) + && Objects.equals(this.storedPaymentMethodId, bankAccountV3.storedPaymentMethodId); } @Override public int hashCode() { - return Objects.hash(accountHolder, accountIdentification); + return Objects.hash(accountHolder, accountIdentification, storedPaymentMethodId); } @Override @@ -125,6 +212,9 @@ public String toString() { sb.append(" accountIdentification: ") .append(toIndentedString(accountIdentification)) .append("\n"); + sb.append(" storedPaymentMethodId: ") + .append(toIndentedString(storedPaymentMethodId)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -139,6 +229,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankAccountV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java b/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java index 12d2f75db..01eef6886 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,14 +29,14 @@ public class BankCategoryData { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ public enum PriorityEnum { @@ -88,6 +90,9 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + /** **bank** */ public enum TypeEnum { BANK(String.valueOf("bank")); @@ -130,62 +135,72 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankCategoryData() {} /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * @return the current {@code BankCategoryData} instance, allowing for method chaining */ public BankCategoryData priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @return priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @@ -197,32 +212,33 @@ public PriorityEnum getPriority() { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -233,6 +249,7 @@ public void setPriority(PriorityEnum priority) { */ public BankCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -256,6 +273,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankCategoryData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankCategoryData object is equal to o. */ @@ -297,6 +335,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java index e1c0ce47d..3f7201441 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,6 +35,9 @@ public class CALocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -79,12 +84,21 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_INSTITUTION_NUMBER = "institutionNumber"; private String institutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; private String transitNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + /** **caLocal** */ public enum TypeEnum { CALOCAL(String.valueOf("caLocal")); @@ -127,6 +141,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CALocalAccountIdentification() {} /** @@ -137,6 +160,7 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -160,6 +184,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -171,6 +196,7 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -196,6 +222,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -206,6 +233,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set return this; } @@ -229,6 +257,7 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set } /** @@ -239,6 +268,7 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set return this; } @@ -262,6 +292,7 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set } /** @@ -272,6 +303,7 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -295,6 +327,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CALocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CALocalAccountIdentification object is equal to o. */ @@ -342,6 +395,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java index a46f58f0b..54aa9a127 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class CZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **czLocal** */ public enum TypeEnum { CZLOCAL(String.valueOf("czLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CZLocalAccountIdentification() {} /** @@ -94,6 +111,7 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -133,6 +151,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CZLocalAccountIdentification object is equal to o. */ @@ -242,6 +285,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Card.java b/src/main/java/com/adyen/model/transferwebhooks/Card.java index f7fe6a73b..6cc9b982d 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Card.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Card.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Card { public static final String JSON_PROPERTY_CARD_HOLDER = "cardHolder"; private PartyIdentification cardHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolder = false; + public static final String JSON_PROPERTY_CARD_IDENTIFICATION = "cardIdentification"; private CardIdentification cardIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIdentification = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Card() {} /** @@ -36,6 +50,7 @@ public Card() {} */ public Card cardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set return this; } @@ -59,6 +74,7 @@ public PartyIdentification getCardHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCardHolder(PartyIdentification cardHolder) { */ public Card cardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set return this; } @@ -92,6 +109,27 @@ public CardIdentification getCardIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Card includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Card object is equal to o. */ @@ -133,6 +171,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardHolder) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER, this.cardHolder); + } + if (isSetCardIdentification) { + addIfNull(nulls, JSON_PROPERTY_CARD_IDENTIFICATION, this.cardIdentification); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Card given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java index 5b6e43a02..c75293338 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,24 +33,51 @@ public class CardIdentification { public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_ISSUE_NUMBER = "issueNumber"; private String issueNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssueNumber = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_START_MONTH = "startMonth"; private String startMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartMonth = false; + public static final String JSON_PROPERTY_START_YEAR = "startYear"; private String startYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartYear = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardIdentification() {} /** @@ -61,6 +90,7 @@ public CardIdentification() {} */ public CardIdentification expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -88,6 +118,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -98,6 +129,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardIdentification expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -121,6 +153,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -131,6 +164,7 @@ public void setExpiryYear(String expiryYear) { */ public CardIdentification issueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set return this; } @@ -154,6 +188,7 @@ public String getIssueNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set } /** @@ -166,6 +201,7 @@ public void setIssueNumber(String issueNumber) { */ public CardIdentification number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -193,6 +229,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -206,6 +243,7 @@ public void setNumber(String number) { */ public CardIdentification startMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set return this; } @@ -235,6 +273,7 @@ public String getStartMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set } /** @@ -247,6 +286,7 @@ public void setStartMonth(String startMonth) { */ public CardIdentification startYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set return this; } @@ -274,6 +314,7 @@ public String getStartYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set } /** @@ -288,6 +329,7 @@ public void setStartYear(String startYear) { */ public CardIdentification storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -319,6 +361,27 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardIdentification object is equal to o. */ @@ -373,6 +436,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetIssueNumber) { + addIfNull(nulls, JSON_PROPERTY_ISSUE_NUMBER, this.issueNumber); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetStartMonth) { + addIfNull(nulls, JSON_PROPERTY_START_MONTH, this.startMonth); + } + if (isSetStartYear) { + addIfNull(nulls, JSON_PROPERTY_START_YEAR, this.startYear); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java index 37c66d92c..bd352549c 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -75,6 +77,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The type of the tracking event. Possible values: - **confirmation**: the transfer passed * Adyen's internal review. @@ -120,6 +125,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ConfirmationTrackingData() {} /** @@ -134,6 +148,7 @@ public ConfirmationTrackingData() {} */ public ConfirmationTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -165,6 +180,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -177,6 +193,7 @@ public void setStatus(StatusEnum status) { */ public ConfirmationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -204,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ConfirmationTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ConfirmationTrackingData object is equal to o. */ @@ -245,6 +283,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ConfirmationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java b/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java index bb8a1a793..aeeed2dba 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class CounterpartyV3 { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_MERCHANT = "merchant"; private MerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyV3() {} /** @@ -53,6 +76,7 @@ public CounterpartyV3() {} */ public CounterpartyV3 balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -80,6 +104,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -90,6 +115,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public CounterpartyV3 bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -113,6 +139,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -123,6 +150,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public CounterpartyV3 card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -146,6 +174,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -156,6 +185,7 @@ public void setCard(Card card) { */ public CounterpartyV3 merchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -179,6 +209,7 @@ public MerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -191,6 +222,7 @@ public void setMerchant(MerchantData merchant) { */ public CounterpartyV3 transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -218,6 +250,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyV3 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CounterpartyV3 object is equal to o. */ @@ -267,6 +320,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CounterpartyV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java index 86a651b02..f735d25d2 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class DKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **dkLocal** */ public enum TypeEnum { DKLOCAL(String.valueOf("dkLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DKLocalAccountIdentification() {} /** @@ -87,6 +104,7 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -112,6 +130,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DKLocalAccountIdentification object is equal to o. */ @@ -222,6 +265,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java b/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java index c4944dac4..dd775cadd 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,15 +31,33 @@ public class DirectDebitInformation { public static final String JSON_PROPERTY_DATE_OF_SIGNATURE = "dateOfSignature"; private OffsetDateTime dateOfSignature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfSignature = false; + public static final String JSON_PROPERTY_DUE_DATE = "dueDate"; private OffsetDateTime dueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDueDate = false; + public static final String JSON_PROPERTY_MANDATE_ID = "mandateId"; private String mandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandateId = false; + public static final String JSON_PROPERTY_SEQUENCE_TYPE = "sequenceType"; private String sequenceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DirectDebitInformation() {} /** @@ -50,6 +70,7 @@ public DirectDebitInformation() {} */ public DirectDebitInformation dateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set return this; } @@ -77,6 +98,7 @@ public OffsetDateTime getDateOfSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set } /** @@ -87,6 +109,7 @@ public void setDateOfSignature(OffsetDateTime dateOfSignature) { */ public DirectDebitInformation dueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set return this; } @@ -110,6 +133,7 @@ public OffsetDateTime getDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set } /** @@ -120,6 +144,7 @@ public void setDueDate(OffsetDateTime dueDate) { */ public DirectDebitInformation mandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set return this; } @@ -143,6 +168,7 @@ public String getMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set } /** @@ -155,6 +181,7 @@ public void setMandateId(String mandateId) { */ public DirectDebitInformation sequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set return this; } @@ -182,6 +209,27 @@ public String getSequenceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DirectDebitInformation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DirectDebitInformation object is equal to o. */ @@ -227,6 +275,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDateOfSignature) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_SIGNATURE, this.dateOfSignature); + } + if (isSetDueDate) { + addIfNull(nulls, JSON_PROPERTY_DUE_DATE, this.dueDate); + } + if (isSetMandateId) { + addIfNull(nulls, JSON_PROPERTY_MANDATE_ID, this.mandateId); + } + if (isSetSequenceType) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_TYPE, this.sequenceType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DirectDebitInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java index 15e7f11e8..00aec15d8 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class EstimationTrackingData { public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + /** * The type of tracking event. Possible values: - **estimation**: the estimated date and time of * when the funds will be credited has been determined. @@ -76,6 +81,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EstimationTrackingData() {} /** @@ -86,6 +100,7 @@ public EstimationTrackingData() {} */ public EstimationTrackingData estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -110,6 +125,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -122,6 +138,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public EstimationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -149,6 +166,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EstimationTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EstimationTrackingData object is equal to o. */ @@ -192,6 +230,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EstimationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java b/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java index 7590e2320..92c5e7bb6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -24,9 +26,21 @@ public class ExecutionDate { public static final String JSON_PROPERTY_DATE = "date"; private LocalDate date; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDate = false; + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; private String timezone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimezone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExecutionDate() {} /** @@ -43,6 +57,7 @@ public ExecutionDate() {} */ public ExecutionDate date(LocalDate date) { this.date = date; + isSetDate = true; // mark as set return this; } @@ -78,6 +93,7 @@ public LocalDate getDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDate(LocalDate date) { this.date = date; + isSetDate = true; // mark as set } /** @@ -92,6 +108,7 @@ public void setDate(LocalDate date) { */ public ExecutionDate timezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set return this; } @@ -123,6 +140,27 @@ public String getTimezone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExecutionDate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ExecutionDate object is equal to o. */ @@ -164,6 +202,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDate) { + addIfNull(nulls, JSON_PROPERTY_DATE, this.date); + } + if (isSetTimezone) { + addIfNull(nulls, JSON_PROPERTY_TIMEZONE, this.timezone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ExecutionDate given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java b/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java index 23eb589fe..d0763e79b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ExternalReason { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; private String namespace; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNamespace = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExternalReason() {} /** @@ -43,6 +60,7 @@ public ExternalReason() {} */ public ExternalReason code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCode(String code) { */ public ExternalReason description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setDescription(String description) { */ public ExternalReason namespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getNamespace() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNamespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExternalReason includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ExternalReason object is equal to o. */ @@ -175,6 +218,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetNamespace) { + addIfNull(nulls, JSON_PROPERTY_NAMESPACE, this.namespace); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ExternalReason given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java index 01fcbfd81..c76a1dfc5 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class HKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; private String clearingCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + /** **hkLocal** */ public enum TypeEnum { HKLOCAL(String.valueOf("hkLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public HKLocalAccountIdentification() {} /** @@ -88,6 +105,7 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -115,6 +133,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this HKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java index fccfad5ec..e20f05d41 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class HULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **huLocal** */ public enum TypeEnum { HULOCAL(String.valueOf("huLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public HULocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this HULocalAccountIdentification object is equal to o. */ @@ -179,6 +217,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java index 3d44f7cc4..60a3b8e2a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IbanAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IbanAccountIdentification object is equal to o. */ @@ -185,6 +223,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java b/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java index 3139106aa..1cdbf7fff 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +34,15 @@ public class InternalCategoryData { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + /** **internal** */ public enum TypeEnum { INTERNAL(String.valueOf("internal")); @@ -77,6 +85,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InternalCategoryData() {} /** @@ -88,6 +105,7 @@ public InternalCategoryData() {} */ public InternalCategoryData modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -113,6 +131,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public InternalCategoryData modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public InternalCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InternalCategoryData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InternalCategoryData object is equal to o. */ @@ -228,6 +271,37 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InternalCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java index a67616193..f5b519c8b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -74,6 +76,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** * The status of the transfer. Possible values: - **pending**: the transfer is under internal * review by Adyen. - **failed**: the transfer failed Adyen's internal review. For details, @@ -122,6 +127,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The type of tracking event. Possible values: - **internalReview**: the transfer was flagged * because it does not comply with Adyen's risk policy. @@ -167,6 +175,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InternalReviewTrackingData() {} /** @@ -182,6 +199,7 @@ public InternalReviewTrackingData() {} */ public InternalReviewTrackingData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -215,6 +233,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -229,6 +248,7 @@ public void setReason(ReasonEnum reason) { */ public InternalReviewTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -260,6 +280,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -272,6 +293,7 @@ public void setStatus(StatusEnum status) { */ public InternalReviewTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -299,6 +321,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InternalReviewTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InternalReviewTrackingData object is equal to o. */ @@ -342,6 +385,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InternalReviewTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java b/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java index b464f625f..1cbcda685 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,6 +41,9 @@ public class IssuedCard { public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; private String authorisationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationType = false; + /** * Indicates the method used for entering the PAN to initiate a transaction. Possible values: * **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. @@ -96,6 +101,9 @@ public static PanEntryModeEnum fromValue(String value) { public static final String JSON_PROPERTY_PAN_ENTRY_MODE = "panEntryMode"; private PanEntryModeEnum panEntryMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPanEntryMode = false; + /** * Contains information about how the payment was processed. For example, **ecommerce** for online * or **pos** for in-person payments. @@ -155,19 +163,34 @@ public static ProcessingTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PROCESSING_TYPE = "processingType"; private ProcessingTypeEnum processingType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProcessingType = false; + public static final String JSON_PROPERTY_RELAYED_AUTHORISATION_DATA = "relayedAuthorisationData"; private RelayedAuthorisationData relayedAuthorisationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRelayedAuthorisationData = false; + public static final String JSON_PROPERTY_SCHEME_TRACE_ID = "schemeTraceId"; private String schemeTraceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeTraceId = false; + public static final String JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID = "schemeUniqueTransactionId"; private String schemeUniqueTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeUniqueTransactionId = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private ThreeDSecure threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + /** **issuedCard** */ public enum TypeEnum { ISSUEDCARD(String.valueOf("issuedCard")); @@ -210,9 +233,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VALIDATION_FACTS = "validationFacts"; private List validationFacts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidationFacts = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuedCard() {} /** @@ -225,6 +260,7 @@ public IssuedCard() {} */ public IssuedCard authorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set return this; } @@ -252,6 +288,7 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set } /** @@ -265,6 +302,7 @@ public void setAuthorisationType(String authorisationType) { */ public IssuedCard panEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set return this; } @@ -294,6 +332,7 @@ public PanEntryModeEnum getPanEntryMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPanEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set } /** @@ -306,6 +345,7 @@ public void setPanEntryMode(PanEntryModeEnum panEntryMode) { */ public IssuedCard processingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set return this; } @@ -333,6 +373,7 @@ public ProcessingTypeEnum getProcessingType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set } /** @@ -343,6 +384,7 @@ public void setProcessingType(ProcessingTypeEnum processingType) { */ public IssuedCard relayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set return this; } @@ -366,6 +408,7 @@ public RelayedAuthorisationData getRelayedAuthorisationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set } /** @@ -384,6 +427,7 @@ public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthoris */ public IssuedCard schemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set return this; } @@ -423,6 +467,7 @@ public String getSchemeTraceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set } /** @@ -435,6 +480,7 @@ public void setSchemeTraceId(String schemeTraceId) { */ public IssuedCard schemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set return this; } @@ -462,6 +508,7 @@ public String getSchemeUniqueTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set } /** @@ -472,6 +519,7 @@ public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { */ public IssuedCard threeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -495,6 +543,7 @@ public ThreeDSecure getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -505,6 +554,7 @@ public void setThreeDSecure(ThreeDSecure threeDSecure) { */ public IssuedCard type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -528,6 +578,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -540,6 +591,7 @@ public void setType(TypeEnum type) { */ public IssuedCard validationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set return this; } @@ -575,6 +627,27 @@ public List getValidationFacts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuedCard includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IssuedCard object is equal to o. */ @@ -643,6 +716,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthorisationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); + } + if (isSetPanEntryMode) { + addIfNull(nulls, JSON_PROPERTY_PAN_ENTRY_MODE, this.panEntryMode); + } + if (isSetProcessingType) { + addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPE, this.processingType); + } + if (isSetRelayedAuthorisationData) { + addIfNull(nulls, JSON_PROPERTY_RELAYED_AUTHORISATION_DATA, this.relayedAuthorisationData); + } + if (isSetSchemeTraceId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_TRACE_ID, this.schemeTraceId); + } + if (isSetSchemeUniqueTransactionId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID, this.schemeUniqueTransactionId); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidationFacts) { + addIfNull(nulls, JSON_PROPERTY_VALIDATION_FACTS, this.validationFacts); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IssuedCard given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java b/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java index f290bcec6..9f0a221a9 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class IssuingTransactionData { public static final String JSON_PROPERTY_CAPTURE_CYCLE_ID = "captureCycleId"; private String captureCycleId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureCycleId = false; + /** * The type of events data. Possible values: - **issuingTransactionData**: issuing transaction * data @@ -75,6 +80,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuingTransactionData() {} /** @@ -85,6 +99,7 @@ public IssuingTransactionData() {} */ public IssuingTransactionData captureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set return this; } @@ -108,6 +123,7 @@ public String getCaptureCycleId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set } /** @@ -120,6 +136,7 @@ public void setCaptureCycleId(String captureCycleId) { */ public IssuingTransactionData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -147,6 +164,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuingTransactionData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IssuingTransactionData object is equal to o. */ @@ -188,6 +226,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCaptureCycleId) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_CYCLE_ID, this.captureCycleId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IssuingTransactionData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Leg.java b/src/main/java/com/adyen/model/transferwebhooks/Leg.java index 01040e074..c0af4def6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Leg.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Leg.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Leg { public static final String JSON_PROPERTY_ARRIVAL_AIRPORT_CODE = "arrivalAirportCode"; private String arrivalAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArrivalAirportCode = false; + public static final String JSON_PROPERTY_BASIC_FARE_CODE = "basicFareCode"; private String basicFareCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasicFareCode = false; + public static final String JSON_PROPERTY_CARRIER_CODE = "carrierCode"; private String carrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierCode = false; + public static final String JSON_PROPERTY_DEPARTURE_AIRPORT_CODE = "departureAirportCode"; private String departureAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureAirportCode = false; + public static final String JSON_PROPERTY_DEPARTURE_DATE = "departureDate"; private String departureDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureDate = false; + public static final String JSON_PROPERTY_FLIGHT_NUMBER = "flightNumber"; private String flightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Leg() {} /** @@ -57,6 +83,7 @@ public Leg() {} */ public Leg arrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getArrivalAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set } /** @@ -94,6 +122,7 @@ public void setArrivalAirportCode(String arrivalAirportCode) { */ public Leg basicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getBasicFareCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set } /** @@ -127,6 +157,7 @@ public void setBasicFareCode(String basicFareCode) { */ public Leg carrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set return this; } @@ -150,6 +181,7 @@ public String getCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set } /** @@ -162,6 +194,7 @@ public void setCarrierCode(String carrierCode) { */ public Leg departureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set return this; } @@ -189,6 +222,7 @@ public String getDepartureAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set } /** @@ -199,6 +233,7 @@ public void setDepartureAirportCode(String departureAirportCode) { */ public Leg departureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set return this; } @@ -222,6 +257,7 @@ public String getDepartureDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set } /** @@ -232,6 +268,7 @@ public void setDepartureDate(String departureDate) { */ public Leg flightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set return this; } @@ -255,6 +292,27 @@ public String getFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Leg includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Leg object is equal to o. */ @@ -312,6 +370,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetArrivalAirportCode) { + addIfNull(nulls, JSON_PROPERTY_ARRIVAL_AIRPORT_CODE, this.arrivalAirportCode); + } + if (isSetBasicFareCode) { + addIfNull(nulls, JSON_PROPERTY_BASIC_FARE_CODE, this.basicFareCode); + } + if (isSetCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_CODE, this.carrierCode); + } + if (isSetDepartureAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_AIRPORT_CODE, this.departureAirportCode); + } + if (isSetDepartureDate) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_DATE, this.departureDate); + } + if (isSetFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_NUMBER, this.flightNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Leg given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Lodging.java b/src/main/java/com/adyen/model/transferwebhooks/Lodging.java index c007d2416..e01d15872 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Lodging.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Lodging.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Lodging { public static final String JSON_PROPERTY_CHECK_IN_DATE = "checkInDate"; private String checkInDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckInDate = false; + public static final String JSON_PROPERTY_NUMBER_OF_NIGHTS = "numberOfNights"; private Integer numberOfNights; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfNights = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Lodging() {} /** @@ -36,6 +50,7 @@ public Lodging() {} */ public Lodging checkInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCheckInDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCheckInDate(String checkInDate) { */ public Lodging numberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set return this; } @@ -92,6 +109,27 @@ public Integer getNumberOfNights() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Lodging includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Lodging object is equal to o. */ @@ -133,6 +171,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckInDate) { + addIfNull(nulls, JSON_PROPERTY_CHECK_IN_DATE, this.checkInDate); + } + if (isSetNumberOfNights) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_NIGHTS, this.numberOfNights); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Lodging given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java b/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java index cae5b9a6d..5ab75c3d1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class MerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_NAME_LOCATION = "nameLocation"; private NameLocation nameLocation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNameLocation = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantData() {} /** @@ -51,6 +74,7 @@ public MerchantData() {} */ public MerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setAcquirerId(String acquirerId) { */ public MerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setMcc(String mcc) { */ public MerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMerchantId(String merchantId) { */ public MerchantData nameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set return this; } @@ -173,6 +203,7 @@ public NameLocation getNameLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setNameLocation(NameLocation nameLocation) { */ public MerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -206,6 +238,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantData object is equal to o. */ @@ -253,6 +306,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetNameLocation) { + addIfNull(nulls, JSON_PROPERTY_NAME_LOCATION, this.nameLocation); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java b/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java index 52c0ae910..c2f38f27e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +35,15 @@ public class MerchantPurchaseData { public static final String JSON_PROPERTY_AIRLINE = "airline"; private Airline airline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirline = false; + public static final String JSON_PROPERTY_LODGING = "lodging"; private List lodging; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodging = false; + /** * The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data */ @@ -80,6 +88,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantPurchaseData() {} /** @@ -90,6 +107,7 @@ public MerchantPurchaseData() {} */ public MerchantPurchaseData airline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set return this; } @@ -113,6 +131,7 @@ public Airline getAirline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setAirline(Airline airline) { */ public MerchantPurchaseData lodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set return this; } @@ -154,6 +174,7 @@ public List getLodging() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setLodging(List lodging) { */ public MerchantPurchaseData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -190,6 +212,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantPurchaseData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantPurchaseData object is equal to o. */ @@ -233,6 +276,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAirline) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE, this.airline); + } + if (isSetLodging) { + addIfNull(nulls, JSON_PROPERTY_LODGING, this.lodging); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantPurchaseData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Modification.java b/src/main/java/com/adyen/model/transferwebhooks/Modification.java index f7a96dd05..ac83af328 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Modification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Modification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class Modification { public static final String JSON_PROPERTY_DIRECTION = "direction"; private String direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of the transfer event. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -213,9 +224,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Modification() {} /** @@ -226,6 +249,7 @@ public Modification() {} */ public Modification direction(String direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -249,6 +273,7 @@ public String getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(String direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -259,6 +284,7 @@ public void setDirection(String direction) { */ public Modification id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -282,6 +308,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -292,6 +319,7 @@ public void setId(String id) { */ public Modification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -315,6 +343,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -325,6 +354,7 @@ public void setReference(String reference) { */ public Modification status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -348,6 +378,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -358,6 +389,7 @@ public void setStatus(StatusEnum status) { */ public Modification type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -381,6 +413,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Modification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Modification object is equal to o. */ @@ -428,6 +481,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Modification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java index 250b05d9b..8d2f7dc1f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class NOLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **noLocal** */ public enum TypeEnum { NOLOCAL(String.valueOf("noLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NOLocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NOLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NOLocalAccountIdentification object is equal to o. */ @@ -179,6 +217,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java index 14798f3aa..1225865b3 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class NZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **nzLocal** */ public enum TypeEnum { NZLOCAL(String.valueOf("nzLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NZLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NZLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java b/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java index dcd9872ea..9d85afb15 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class NameLocation { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_COUNTRY_OF_ORIGIN = "countryOfOrigin"; private String countryOfOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfOrigin = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_RAW_DATA = "rawData"; private String rawData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRawData = false; + public static final String JSON_PROPERTY_STATE = "state"; private String state; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetState = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NameLocation() {} /** @@ -55,6 +81,7 @@ public NameLocation() {} */ public NameLocation city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -90,6 +118,7 @@ public void setCity(String city) { */ public NameLocation country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -131,6 +161,7 @@ public void setCountry(String country) { */ public NameLocation countryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getCountryOfOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set } /** @@ -172,6 +204,7 @@ public void setCountryOfOrigin(String countryOfOrigin) { */ public NameLocation name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -205,6 +239,7 @@ public void setName(String name) { */ public NameLocation rawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set return this; } @@ -228,6 +263,7 @@ public String getRawData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set } /** @@ -238,6 +274,7 @@ public void setRawData(String rawData) { */ public NameLocation state(String state) { this.state = state; + isSetState = true; // mark as set return this; } @@ -261,6 +298,27 @@ public String getState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setState(String state) { this.state = state; + isSetState = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NameLocation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NameLocation object is equal to o. */ @@ -310,6 +368,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetCountryOfOrigin) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_ORIGIN, this.countryOfOrigin); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetRawData) { + addIfNull(nulls, JSON_PROPERTY_RAW_DATA, this.rawData); + } + if (isSetState) { + addIfNull(nulls, JSON_PROPERTY_STATE, this.state); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NameLocation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java index 49ad71cb7..19278e159 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,13 +34,22 @@ public class NumberAndBicAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; private AdditionalBankIdentification additionalBankIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **numberAndBic** */ public enum TypeEnum { NUMBERANDBIC(String.valueOf("numberAndBic")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NumberAndBicAccountIdentification() {} /** @@ -94,6 +114,7 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +142,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -133,6 +155,7 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -157,6 +180,7 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set } /** @@ -168,6 +192,7 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -191,6 +216,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NumberAndBicAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NumberAndBicAccountIdentification object is equal to o. */ @@ -275,6 +323,40 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java index 5cc7835eb..a70add140 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class PLLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **plLocal** */ public enum TypeEnum { PLLOCAL(String.valueOf("plLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PLLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PLLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PLLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java index f4f324c6d..de9161a5e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,24 +40,45 @@ public class PartyIdentification { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The type of entity that owns the bank account or card. Possible values: **individual**, * **organization**, or **unknown**. Required when `category` is **card**. In this case, @@ -106,9 +129,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PartyIdentification() {} /** @@ -119,6 +154,7 @@ public PartyIdentification() {} */ public PartyIdentification address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -142,6 +178,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -155,6 +192,7 @@ public void setAddress(Address address) { */ public PartyIdentification dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -184,6 +222,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -195,6 +234,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PartyIdentification email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -220,6 +260,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -234,6 +275,7 @@ public void setEmail(String email) { */ public PartyIdentification firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -265,6 +307,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -279,6 +322,7 @@ public void setFirstName(String firstName) { */ public PartyIdentification fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -310,6 +354,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -324,6 +369,7 @@ public void setFullName(String fullName) { */ public PartyIdentification lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -355,6 +401,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -369,6 +416,7 @@ public void setLastName(String lastName) { */ public PartyIdentification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -400,6 +448,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -414,6 +463,7 @@ public void setReference(String reference) { */ public PartyIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -445,6 +495,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -455,6 +506,7 @@ public void setType(TypeEnum type) { */ public PartyIdentification url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -478,6 +530,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PartyIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PartyIdentification object is equal to o. */ @@ -534,6 +607,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PartyIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java index 0a21fdd52..66f8194e1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class PaymentInstrument { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TOKEN_TYPE = "tokenType"; private String tokenType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrument() {} /** @@ -47,6 +67,7 @@ public PaymentInstrument() {} */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setId(String id) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setReference(String reference) { */ public PaymentInstrument tokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getTokenType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrument includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrument object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTokenType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_TYPE, this.tokenType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java b/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java index a68fab379..15051ed69 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,33 +37,42 @@ public class PlatformPayment { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + public static final String JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE = "paymentMerchantReference"; private String paymentMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMerchantReference = false; + /** * Specifies the nature of the transfer. This parameter helps categorize transfers so you can * reconcile transactions at a later time, using the Balance Platform Accounting Report for * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. */ public enum PlatformPaymentTypeEnum { @@ -137,9 +148,15 @@ public static PlatformPaymentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PLATFORM_PAYMENT_TYPE = "platformPaymentType"; private PlatformPaymentTypeEnum platformPaymentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentType = false; + public static final String JSON_PROPERTY_PSP_PAYMENT_REFERENCE = "pspPaymentReference"; private String pspPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspPaymentReference = false; + /** **platformPayment** */ public enum TypeEnum { PLATFORMPAYMENT(String.valueOf("platformPayment")); @@ -182,6 +199,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PlatformPayment() {} /** @@ -193,6 +219,7 @@ public PlatformPayment() {} */ public PlatformPayment modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -218,6 +245,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -228,6 +256,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public PlatformPayment modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -251,6 +280,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -261,6 +291,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public PlatformPayment paymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set return this; } @@ -284,6 +315,7 @@ public String getPaymentMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set } /** @@ -292,21 +324,21 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @param platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -315,26 +347,27 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. * @return the current {@code PlatformPayment} instance, allowing for method chaining */ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set return this; } @@ -344,21 +377,21 @@ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPayme * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @return platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -367,22 +400,22 @@ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPayme * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. */ @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -396,21 +429,21 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @param platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -419,27 +452,28 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. */ @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set } /** @@ -450,6 +484,7 @@ public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) */ public PlatformPayment pspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set return this; } @@ -473,6 +508,7 @@ public String getPspPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set } /** @@ -483,6 +519,7 @@ public void setPspPaymentReference(String pspPaymentReference) { */ public PlatformPayment type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +543,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PlatformPayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PlatformPayment object is equal to o. */ @@ -572,6 +630,46 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + if (isSetPaymentMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE, this.paymentMerchantReference); + } + if (isSetPlatformPaymentType) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_PAYMENT_TYPE, this.platformPaymentType); + } + if (isSetPspPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_PAYMENT_REFERENCE, this.pspPaymentReference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PlatformPayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java b/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java index ddc54408d..5e72f3201 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class RelayedAuthorisationData { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RelayedAuthorisationData() {} /** @@ -43,6 +57,7 @@ public RelayedAuthorisationData() {} */ public RelayedAuthorisationData metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -78,6 +93,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -88,6 +104,7 @@ public void setMetadata(Map metadata) { */ public RelayedAuthorisationData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -111,6 +128,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RelayedAuthorisationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RelayedAuthorisationData object is equal to o. */ @@ -152,6 +190,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RelayedAuthorisationData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Resource.java b/src/main/java/com/adyen/model/transferwebhooks/Resource.java index 960a64abd..d557a4955 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Resource.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Resource.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,12 +30,27 @@ public class Resource { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Resource() {} /** @@ -44,6 +61,7 @@ public Resource() {} */ public Resource balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -67,6 +85,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -79,6 +98,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Resource creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -106,6 +126,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -116,6 +137,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Resource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -139,6 +161,27 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Resource includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Resource object is equal to o. */ @@ -182,6 +225,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java index b3fe1de89..bee51fc2e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -175,6 +218,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java index cbebe8b71..04ff1b0c1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class SELocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; private String clearingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + /** **seLocal** */ public enum TypeEnum { SELOCAL(String.valueOf("seLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SELocalAccountIdentification() {} /** @@ -90,6 +107,7 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -135,6 +154,7 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SELocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SELocalAccountIdentification object is equal to o. */ @@ -242,6 +285,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java index 1d088d87f..c7ca64c78 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class SGLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **sgLocal** */ public enum TypeEnum { SGLOCAL(String.valueOf("sgLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SGLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -142,6 +162,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -152,6 +173,7 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +197,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SGLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SGLocalAccountIdentification object is equal to o. */ @@ -218,6 +261,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java b/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java index bda7e6d8f..5faa3a1c6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class ThreeDSecure { public static final String JSON_PROPERTY_ACS_TRANSACTION_ID = "acsTransactionId"; private String acsTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransactionId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSecure() {} /** @@ -33,6 +44,7 @@ public ThreeDSecure() {} */ public ThreeDSecure acsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getAcsTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSecure includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDSecure object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcsTransactionId) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANSACTION_ID, this.acsTransactionId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java index bf42d1869..74f718469 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class TransactionEventViolation { public static final String JSON_PROPERTY_REASON = "reason"; private String reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; private TransactionRuleReference transactionRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRule = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE_SOURCE = "transactionRuleSource"; private TransactionRuleSource transactionRuleSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRuleSource = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionEventViolation() {} /** @@ -43,6 +60,7 @@ public TransactionEventViolation() {} */ public TransactionEventViolation reason(String reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setReason(String reason) { */ public TransactionEventViolation transactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set return this; } @@ -99,6 +119,7 @@ public TransactionRuleReference getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setTransactionRule(TransactionRuleReference transactionRule) { public TransactionEventViolation transactionRuleSource( TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set return this; } @@ -133,6 +155,27 @@ public TransactionRuleSource getTransactionRuleSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRuleSource(TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionEventViolation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionEventViolation object is equal to o. */ @@ -179,6 +222,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetTransactionRule) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); + } + if (isSetTransactionRuleSource) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE_SOURCE, this.transactionRuleSource); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionEventViolation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java index 73caf743b..9aef6e6fa 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class TransactionRuleReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private String outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleReference() {} /** @@ -51,6 +74,7 @@ public TransactionRuleReference() {} */ public TransactionRuleReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setDescription(String description) { */ public TransactionRuleReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setId(String id) { */ public TransactionRuleReference outcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setOutcomeType(String outcomeType) { */ public TransactionRuleReference reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -185,6 +216,7 @@ public void setReference(String reference) { */ public TransactionRuleReference score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -212,6 +244,27 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleReference object is equal to o. */ @@ -259,6 +312,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java index 73cab0fca..d820e4a6e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TransactionRuleSource { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleSource() {} /** @@ -39,6 +53,7 @@ public TransactionRuleSource() {} */ public TransactionRuleSource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setId(String id) { */ public TransactionRuleSource type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleSource includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleSource object is equal to o. */ @@ -154,6 +192,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleSource given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java index 8a6be6073..821bfc074 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,16 +32,34 @@ public class TransactionRulesResult { public static final String JSON_PROPERTY_ADVICE = "advice"; private String advice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdvice = false; + public static final String JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED = "allHardBlockRulesPassed"; private Boolean allHardBlockRulesPassed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllHardBlockRulesPassed = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES = "triggeredTransactionRules"; private List triggeredTransactionRules; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggeredTransactionRules = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRulesResult() {} /** @@ -50,6 +70,7 @@ public TransactionRulesResult() {} */ public TransactionRulesResult advice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set return this; } @@ -73,6 +94,7 @@ public String getAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdvice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAdvice(String advice) { */ public TransactionRulesResult allHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Boolean getAllHardBlockRulesPassed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { */ public TransactionRulesResult score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -154,6 +180,7 @@ public void setScore(Integer score) { public TransactionRulesResult triggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set return this; } @@ -189,6 +216,27 @@ public List getTriggeredTransactionRules() { public void setTriggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRulesResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRulesResult object is equal to o. */ @@ -240,6 +288,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdvice) { + addIfNull(nulls, JSON_PROPERTY_ADVICE, this.advice); + } + if (isSetAllHardBlockRulesPassed) { + addIfNull(nulls, JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED, this.allHardBlockRulesPassed); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetTriggeredTransactionRules) { + addIfNull(nulls, JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES, this.triggeredTransactionRules); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRulesResult given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java b/src/main/java/com/adyen/model/transferwebhooks/TransferData.java index 019807d3e..83f39f66b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -60,27 +62,42 @@ public class TransferData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. */ public enum CategoryEnum { BANK(String.valueOf("bank")), @@ -133,25 +150,46 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferDataCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private TransferNotificationCounterParty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; @Deprecated // deprecated since Transfer webhooks v3: Use createdAt or updatedAt private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_DIRECT_DEBIT_INFORMATION = "directDebitInformation"; private DirectDebitInformation directDebitInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectDebitInformation = false; + /** The direction of the transfer. Possible values: **incoming**, **outgoing**. */ public enum DirectionEnum { INCOMING(String.valueOf("incoming")), @@ -196,24 +234,45 @@ public static DirectionEnum fromValue(String value) { public static final String JSON_PROPERTY_DIRECTION = "direction"; private DirectionEnum direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_EVENT_ID = "eventId"; private String eventId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventId = false; + public static final String JSON_PROPERTY_EVENTS = "events"; private List events; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEvents = false; + public static final String JSON_PROPERTY_EXECUTION_DATE = "executionDate"; private ExecutionDate executionDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecutionDate = false; + public static final String JSON_PROPERTY_EXTERNAL_REASON = "externalReason"; private ExternalReason externalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalReason = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + /** Additional information about the status of the transfer. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -263,6 +322,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -305,24 +366,41 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_REVIEW = "review"; private TransferReview review; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReview = false; + public static final String JSON_PROPERTY_SEQUENCE_NUMBER = "sequenceNumber"; private Integer sequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceNumber = false; + /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -497,12 +575,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TRACKING = "tracking"; private TransferDataTracking tracking; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTracking = false; + public static final String JSON_PROPERTY_TRANSACTION_RULES_RESULT = "transactionRulesResult"; private TransactionRulesResult transactionRulesResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRulesResult = false; + /** * The type of transfer or transaction. For example, **refund**, **payment**, * **internalTransfer**, **bankTransfer**. @@ -622,9 +709,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; private OffsetDateTime updatedAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdatedAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferData() {} /** @@ -635,6 +734,7 @@ public TransferData() {} */ public TransferData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -658,6 +758,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -668,6 +769,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public TransferData amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -691,6 +793,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -701,6 +804,7 @@ public void setAmount(Amount amount) { */ public TransferData balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -724,6 +828,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -734,6 +839,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public TransferData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -757,6 +863,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -767,6 +874,7 @@ public void setBalancePlatform(String balancePlatform) { */ public TransferData balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -798,53 +906,55 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @return category The category of the transfer. Possible values: - **bank**: a transfer + * @return category The category of the transfer. Possible values: - **bank**: A transfer * involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -853,29 +963,30 @@ public CategoryEnum getCategory() { } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -886,6 +997,7 @@ public void setCategory(CategoryEnum category) { */ public TransferData categoryData(TransferDataCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -909,6 +1021,7 @@ public TransferDataCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferDataCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -919,6 +1032,7 @@ public void setCategoryData(TransferDataCategoryData categoryData) { */ public TransferData counterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -942,6 +1056,7 @@ public TransferNotificationCounterParty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -954,6 +1069,7 @@ public void setCounterparty(TransferNotificationCounterParty counterparty) { */ public TransferData createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -981,6 +1097,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -995,6 +1112,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { @Deprecated // deprecated since Transfer webhooks v3: Use createdAt or updatedAt public TransferData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -1026,6 +1144,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -1044,6 +1163,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public TransferData description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -1083,6 +1203,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -1093,6 +1214,7 @@ public void setDescription(String description) { */ public TransferData directDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set return this; } @@ -1116,6 +1238,7 @@ public DirectDebitInformation getDirectDebitInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set } /** @@ -1126,6 +1249,7 @@ public void setDirectDebitInformation(DirectDebitInformation directDebitInformat */ public TransferData direction(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -1149,6 +1273,7 @@ public DirectionEnum getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -1161,6 +1286,7 @@ public void setDirection(DirectionEnum direction) { */ public TransferData eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -1188,6 +1314,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -1198,6 +1325,7 @@ public void setEventId(String eventId) { */ public TransferData events(List events) { this.events = events; + isSetEvents = true; // mark as set return this; } @@ -1229,6 +1357,7 @@ public List getEvents() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEvents(List events) { this.events = events; + isSetEvents = true; // mark as set } /** @@ -1239,6 +1368,7 @@ public void setEvents(List events) { */ public TransferData executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -1262,6 +1392,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -1272,6 +1403,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public TransferData externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -1295,6 +1427,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -1305,6 +1438,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -1328,6 +1462,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -1338,6 +1473,7 @@ public void setId(String id) { */ public TransferData paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -1361,6 +1497,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -1371,6 +1508,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public TransferData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -1394,6 +1532,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -1406,6 +1545,7 @@ public void setReason(ReasonEnum reason) { */ public TransferData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1433,6 +1573,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1451,6 +1592,7 @@ public void setReference(String reference) { */ public TransferData referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -1490,6 +1632,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -1500,6 +1643,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public TransferData review(TransferReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1523,6 +1667,7 @@ public TransferReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferReview review) { this.review = review; + isSetReview = true; // mark as set } /** @@ -1537,6 +1682,7 @@ public void setReview(TransferReview review) { */ public TransferData sequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set return this; } @@ -1568,39 +1714,51 @@ public Integer getSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @return status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1610,21 +1768,27 @@ public StatusEnum getStatus() { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -1635,6 +1799,7 @@ public void setStatus(StatusEnum status) { */ public TransferData tracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set return this; } @@ -1658,6 +1823,7 @@ public TransferDataTracking getTracking() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set } /** @@ -1668,6 +1834,7 @@ public void setTracking(TransferDataTracking tracking) { */ public TransferData transactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set return this; } @@ -1691,6 +1858,7 @@ public TransactionRulesResult getTransactionRulesResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set } /** @@ -1703,6 +1871,7 @@ public void setTransactionRulesResult(TransactionRulesResult transactionRulesRes */ public TransferData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1730,6 +1899,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1742,6 +1912,7 @@ public void setType(TypeEnum type) { */ public TransferData updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set return this; } @@ -1769,6 +1940,27 @@ public OffsetDateTime getUpdatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferData object is equal to o. */ @@ -1899,6 +2091,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDirectDebitInformation) { + addIfNull(nulls, JSON_PROPERTY_DIRECT_DEBIT_INFORMATION, this.directDebitInformation); + } + if (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetEventId) { + addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); + } + if (isSetEvents) { + addIfNull(nulls, JSON_PROPERTY_EVENTS, this.events); + } + if (isSetExecutionDate) { + addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); + } + if (isSetExternalReason) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetReview) { + addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); + } + if (isSetSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_NUMBER, this.sequenceNumber); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTracking) { + addIfNull(nulls, JSON_PROPERTY_TRACKING, this.tracking); + } + if (isSetTransactionRulesResult) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULES_RESULT, this.transactionRulesResult); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdatedAt) { + addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java index 8e00640c8..0cf3aab77 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -49,36 +51,69 @@ public class TransferEvent { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENTS = "amountAdjustments"; private List amountAdjustments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustments = false; + public static final String JSON_PROPERTY_ARN = "arn"; private String arn; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArn = false; + public static final String JSON_PROPERTY_BOOKING_DATE = "bookingDate"; private OffsetDateTime bookingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBookingDate = false; + public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + public static final String JSON_PROPERTY_EVENTS_DATA = "eventsData"; private List eventsData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventsData = false; + public static final String JSON_PROPERTY_EXTERNAL_REASON = "externalReason"; private ExternalReason externalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalReason = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MODIFICATION = "modification"; private Modification modification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModification = false; + public static final String JSON_PROPERTY_MUTATIONS = "mutations"; private List mutations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMutations = false; + public static final String JSON_PROPERTY_ORIGINAL_AMOUNT = "originalAmount"; private Amount originalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalAmount = false; + /** The reason for the transfer status. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -128,6 +163,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -170,6 +207,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** The status of the transfer event. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -344,12 +384,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TRACKING_DATA = "trackingData"; private TransferEventTrackingData trackingData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackingData = false; + public static final String JSON_PROPERTY_TRANSACTION_ID = "transactionId"; private String transactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionId = false; + /** The type of the transfer event. Possible values: **accounting**, **tracking**. */ public enum TypeEnum { ACCOUNTING(String.valueOf("accounting")), @@ -394,12 +443,27 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_UPDATE_DATE = "updateDate"; private OffsetDateTime updateDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdateDate = false; + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; private OffsetDateTime valueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferEvent() {} /** @@ -410,6 +474,7 @@ public TransferEvent() {} */ public TransferEvent amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -433,6 +498,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -445,6 +511,7 @@ public void setAmount(Amount amount) { */ public TransferEvent amountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set return this; } @@ -480,6 +547,7 @@ public List getAmountAdjustments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set } /** @@ -490,6 +558,7 @@ public void setAmountAdjustments(List amountAdjustments) { */ public TransferEvent arn(String arn) { this.arn = arn; + isSetArn = true; // mark as set return this; } @@ -514,6 +583,7 @@ public String getArn() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArn(String arn) { this.arn = arn; + isSetArn = true; // mark as set } /** @@ -524,6 +594,7 @@ public void setArn(String arn) { */ public TransferEvent bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set return this; } @@ -547,6 +618,7 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set } /** @@ -558,6 +630,7 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public TransferEvent estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -583,6 +656,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -593,6 +667,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public TransferEvent eventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set return this; } @@ -624,6 +699,7 @@ public List getEventsData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set } /** @@ -634,6 +710,7 @@ public void setEventsData(List eventsData) { */ public TransferEvent externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -657,6 +734,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -667,6 +745,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferEvent id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -690,6 +769,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -700,6 +780,7 @@ public void setId(String id) { */ public TransferEvent modification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set return this; } @@ -723,6 +804,7 @@ public Modification getModification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set } /** @@ -733,6 +815,7 @@ public void setModification(Modification modification) { */ public TransferEvent mutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set return this; } @@ -764,6 +847,7 @@ public List getMutations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set } /** @@ -774,6 +858,7 @@ public void setMutations(List mutations) { */ public TransferEvent originalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set return this; } @@ -797,6 +882,7 @@ public Amount getOriginalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set } /** @@ -807,6 +893,7 @@ public void setOriginalAmount(Amount originalAmount) { */ public TransferEvent reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -830,6 +917,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -840,6 +928,7 @@ public void setReason(ReasonEnum reason) { */ public TransferEvent status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -863,6 +952,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -873,6 +963,7 @@ public void setStatus(StatusEnum status) { */ public TransferEvent trackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set return this; } @@ -896,6 +987,7 @@ public TransferEventTrackingData getTrackingData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set } /** @@ -908,6 +1000,7 @@ public void setTrackingData(TransferEventTrackingData trackingData) { */ public TransferEvent transactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set return this; } @@ -935,6 +1028,7 @@ public String getTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set } /** @@ -945,6 +1039,7 @@ public void setTransactionId(String transactionId) { */ public TransferEvent type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -968,6 +1063,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -978,6 +1074,7 @@ public void setType(TypeEnum type) { */ public TransferEvent updateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set return this; } @@ -1001,6 +1098,7 @@ public OffsetDateTime getUpdateDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set } /** @@ -1013,6 +1111,7 @@ public void setUpdateDate(OffsetDateTime updateDate) { */ public TransferEvent valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set return this; } @@ -1040,6 +1139,27 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferEvent includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferEvent object is equal to o. */ @@ -1133,6 +1253,81 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustments) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENTS, this.amountAdjustments); + } + if (isSetArn) { + addIfNull(nulls, JSON_PROPERTY_ARN, this.arn); + } + if (isSetBookingDate) { + addIfNull(nulls, JSON_PROPERTY_BOOKING_DATE, this.bookingDate); + } + if (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + if (isSetEventsData) { + addIfNull(nulls, JSON_PROPERTY_EVENTS_DATA, this.eventsData); + } + if (isSetExternalReason) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetModification) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION, this.modification); + } + if (isSetMutations) { + addIfNull(nulls, JSON_PROPERTY_MUTATIONS, this.mutations); + } + if (isSetOriginalAmount) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_AMOUNT, this.originalAmount); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTrackingData) { + addIfNull(nulls, JSON_PROPERTY_TRACKING_DATA, this.trackingData); + } + if (isSetTransactionId) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_ID, this.transactionId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdateDate) { + addIfNull(nulls, JSON_PROPERTY_UPDATE_DATE, this.updateDate); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferEvent given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java index cb9c7a255..8a72a8e28 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class TransferNotificationCounterParty { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_MERCHANT = "merchant"; private TransferNotificationMerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationCounterParty() {} /** @@ -54,6 +77,7 @@ public TransferNotificationCounterParty() {} */ public TransferNotificationCounterParty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -92,6 +117,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public TransferNotificationCounterParty bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -115,6 +141,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -126,6 +153,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public TransferNotificationCounterParty card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -149,6 +177,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -160,6 +189,7 @@ public void setCard(Card card) { */ public TransferNotificationCounterParty merchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -183,6 +213,7 @@ public TransferNotificationMerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -196,6 +227,7 @@ public void setMerchant(TransferNotificationMerchantData merchant) { */ public TransferNotificationCounterParty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -223,6 +255,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationCounterParty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationCounterParty object is equal to o. */ @@ -274,6 +327,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationCounterParty given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java index 1595c6a5b..44acc9612 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,24 +33,51 @@ public class TransferNotificationMerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationMerchantData() {} /** @@ -60,6 +89,7 @@ public TransferNotificationMerchantData() {} */ public TransferNotificationMerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -83,6 +113,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -94,6 +125,7 @@ public void setAcquirerId(String acquirerId) { */ public TransferNotificationMerchantData city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -117,6 +149,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -128,6 +161,7 @@ public void setCity(String city) { */ public TransferNotificationMerchantData country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -151,6 +185,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -162,6 +197,7 @@ public void setCountry(String country) { */ public TransferNotificationMerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -185,6 +221,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -196,6 +233,7 @@ public void setMcc(String mcc) { */ public TransferNotificationMerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -219,6 +257,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -230,6 +269,7 @@ public void setMerchantId(String merchantId) { */ public TransferNotificationMerchantData name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -253,6 +293,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -264,6 +305,7 @@ public void setName(String name) { */ public TransferNotificationMerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -287,6 +329,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationMerchantData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationMerchantData object is equal to o. */ @@ -339,6 +402,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationMerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java index 3807a8fb1..780f01caa 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class TransferNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private TransferData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** The type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_TRANSFER_CREATED(String.valueOf("balancePlatform.transfer.created")), @@ -83,6 +94,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationRequest() {} /** @@ -93,6 +113,7 @@ public TransferNotificationRequest() {} */ public TransferNotificationRequest data(TransferData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -116,6 +137,7 @@ public TransferData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(TransferData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -127,6 +149,7 @@ public void setData(TransferData data) { */ public TransferNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -152,6 +175,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -162,6 +186,7 @@ public void setEnvironment(String environment) { */ public TransferNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -185,6 +210,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -195,6 +221,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public TransferNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -218,6 +245,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationRequest object is equal to o. */ @@ -263,6 +311,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java index efaaecffd..4a45b436a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TransferNotificationValidationFact { public static final String JSON_PROPERTY_RESULT = "result"; private String result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationValidationFact() {} /** @@ -40,6 +54,7 @@ public TransferNotificationValidationFact() {} */ public TransferNotificationValidationFact result(String result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setResult(String result) { */ public TransferNotificationValidationFact type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationValidationFact includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationValidationFact object is equal to o. */ @@ -139,6 +177,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationValidationFact given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java b/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java index 6d8f4bd11..36129abb4 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class TransferReview { "numberOfApprovalsRequired"; private Integer numberOfApprovalsRequired; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfApprovalsRequired = false; + /** * Shows the status of the Strong Customer Authentication (SCA) process. Possible values: * **required**, **notApplicable**. @@ -80,6 +85,15 @@ public static ScaOnApprovalEnum fromValue(String value) { public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private ScaOnApprovalEnum scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferReview() {} /** @@ -94,6 +108,7 @@ public TransferReview() {} */ public TransferReview numberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set return this; } @@ -125,6 +140,7 @@ public Integer getNumberOfApprovalsRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set } /** @@ -137,6 +153,7 @@ public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { */ public TransferReview scaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -164,6 +181,27 @@ public ScaOnApprovalEnum getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferReview includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferReview object is equal to o. */ @@ -207,6 +245,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNumberOfApprovalsRequired) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_APPROVALS_REQUIRED, this.numberOfApprovalsRequired); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferReview given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java index 726a08c59..71c5fe8d4 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class UKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + /** **ukLocal** */ public enum TypeEnum { UKLOCAL(String.valueOf("ukLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UKLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java index d11a9c0a2..42b852437 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class USLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -78,9 +83,15 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + /** **usLocal** */ public enum TypeEnum { USLOCAL(String.valueOf("usLocal")); @@ -123,6 +134,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public USLocalAccountIdentification() {} /** @@ -133,6 +153,7 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -156,6 +177,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +189,7 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -192,6 +215,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -205,6 +229,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -234,6 +259,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -244,6 +270,7 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -267,6 +294,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public USLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this USLocalAccountIdentification object is equal to o. */ @@ -312,6 +360,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of USLocalAccountIdentification given an JSON string * From 7b83c9f026fa355e3bf220c152e5842186a8b4d7 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Wed, 10 Dec 2025 11:24:04 +0100 Subject: [PATCH 3/4] Regenerate API models --- .../AULocalAccountIdentification.java | 7 +- .../AdditionalBankIdentification.java | 6 +- .../com/adyen/model/transfers/Address.java | 22 ++++++- .../com/adyen/model/transfers/Airline.java | 6 +- .../com/adyen/model/transfers/Amount.java | 6 +- .../model/transfers/AmountAdjustment.java | 14 +++- .../transfers/ApproveTransfersRequest.java | 5 +- .../BRLocalAccountIdentification.java | 19 +++++- .../model/transfers/BalanceMutation.java | 16 ++++- .../adyen/model/transfers/BankAccountV3.java | 14 +++- .../model/transfers/BankCategoryData.java | 6 +- .../CALocalAccountIdentification.java | 20 +++++- .../CZLocalAccountIdentification.java | 8 ++- .../transfers/CancelTransfersRequest.java | 5 +- .../adyen/model/transfers/CapitalBalance.java | 9 ++- .../adyen/model/transfers/CapitalGrant.java | 30 ++++++++- .../model/transfers/CapitalGrantInfo.java | 13 +++- .../adyen/model/transfers/CapitalGrants.java | 5 +- .../java/com/adyen/model/transfers/Card.java | 6 +- .../model/transfers/CardIdentification.java | 25 ++++++- .../transfers/ConfirmationTrackingData.java | 6 +- .../adyen/model/transfers/Counterparty.java | 13 +++- .../model/transfers/CounterpartyInfoV3.java | 17 ++++- .../adyen/model/transfers/CounterpartyV3.java | 19 +++++- .../DKLocalAccountIdentification.java | 8 ++- .../transfers/DirectDebitInformation.java | 16 ++++- .../transfers/EstimationTrackingData.java | 7 +- .../adyen/model/transfers/ExecutionDate.java | 6 +- .../adyen/model/transfers/ExternalReason.java | 7 +- .../java/com/adyen/model/transfers/Fee.java | 5 +- .../transfers/FindTransfersResponse.java | 6 +- .../model/transfers/FundingInstrument.java | 17 ++++- .../HKLocalAccountIdentification.java | 8 ++- .../HULocalAccountIdentification.java | 6 +- .../transfers/IbanAccountIdentification.java | 6 +- .../model/transfers/InternalCategoryData.java | 16 ++++- .../transfers/InternalReviewTrackingData.java | 7 +- .../adyen/model/transfers/InvalidField.java | 7 +- .../com/adyen/model/transfers/IssuedCard.java | 24 ++++++- .../transfers/IssuingTransactionData.java | 6 +- .../java/com/adyen/model/transfers/Leg.java | 16 ++++- .../java/com/adyen/model/transfers/Link.java | 4 +- .../java/com/adyen/model/transfers/Links.java | 7 +- .../com/adyen/model/transfers/Lodging.java | 6 +- .../adyen/model/transfers/MerchantData.java | 19 +++++- .../model/transfers/MerchantPurchaseData.java | 7 +- .../adyen/model/transfers/Modification.java | 19 +++++- .../NOLocalAccountIdentification.java | 6 +- .../NZLocalAccountIdentification.java | 6 +- .../adyen/model/transfers/NameLocation.java | 22 ++++++- .../NumberAndBicAccountIdentification.java | 19 +++++- .../PLLocalAccountIdentification.java | 6 +- .../model/transfers/PartyIdentification.java | 30 ++++++++- .../model/transfers/PaymentInstrument.java | 16 ++++- .../model/transfers/PlatformPayment.java | 20 +++++- .../transfers/RelayedAuthorisationData.java | 6 +- .../com/adyen/model/transfers/Repayment.java | 7 +- .../adyen/model/transfers/RepaymentTerm.java | 6 +- .../model/transfers/ResourceReference.java | 7 +- .../model/transfers/RestServiceError.java | 30 ++++++++- .../transfers/ReturnTransferRequest.java | 6 +- .../transfers/ReturnTransferResponse.java | 9 ++- .../adyen/model/transfers/RoutingDetails.java | 9 ++- .../SELocalAccountIdentification.java | 9 ++- .../SGLocalAccountIdentification.java | 7 +- .../adyen/model/transfers/ServiceError.java | 19 +++++- .../adyen/model/transfers/ThreeDSecure.java | 5 +- .../model/transfers/ThresholdRepayment.java | 5 +- .../adyen/model/transfers/Transaction.java | 31 ++++++++- .../transfers/TransactionEventViolation.java | 14 +++- .../transfers/TransactionRuleReference.java | 19 +++++- .../transfers/TransactionRuleSource.java | 6 +- .../transfers/TransactionRulesResult.java | 19 +++++- .../transfers/TransactionSearchResponse.java | 6 +- .../com/adyen/model/transfers/Transfer.java | 44 ++++++++++++- .../adyen/model/transfers/TransferData.java | 65 ++++++++++++++++++- .../adyen/model/transfers/TransferEvent.java | 40 +++++++++++- .../adyen/model/transfers/TransferInfo.java | 33 +++++++++- .../TransferNotificationCounterParty.java | 22 ++++++- .../TransferNotificationMerchantData.java | 25 ++++++- .../TransferNotificationValidationFact.java | 6 +- .../transfers/TransferRequestReview.java | 12 +++- .../adyen/model/transfers/TransferReview.java | 11 +++- .../TransferServiceRestServiceError.java | 26 +++++++- .../adyen/model/transfers/TransferView.java | 7 +- .../UKLocalAccountIdentification.java | 8 ++- .../USLocalAccountIdentification.java | 16 ++++- .../UltimatePartyIdentification.java | 25 ++++++- 88 files changed, 1036 insertions(+), 176 deletions(-) diff --git a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java index 1366538da..392afce25 100644 --- a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java @@ -237,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 diff --git a/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java index bc049c895..f4b23da23 100644 --- a/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java @@ -260,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 diff --git a/src/main/java/com/adyen/model/transfers/Address.java b/src/main/java/com/adyen/model/transfers/Address.java index 4e954423d..637c885ca 100644 --- a/src/main/java/com/adyen/model/transfers/Address.java +++ b/src/main/java/com/adyen/model/transfers/Address.java @@ -359,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 diff --git a/src/main/java/com/adyen/model/transfers/Airline.java b/src/main/java/com/adyen/model/transfers/Airline.java index f984a8439..501771e08 100644 --- a/src/main/java/com/adyen/model/transfers/Airline.java +++ b/src/main/java/com/adyen/model/transfers/Airline.java @@ -153,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 diff --git a/src/main/java/com/adyen/model/transfers/Amount.java b/src/main/java/com/adyen/model/transfers/Amount.java index b291d2f90..05e7fa74a 100644 --- a/src/main/java/com/adyen/model/transfers/Amount.java +++ b/src/main/java/com/adyen/model/transfers/Amount.java @@ -161,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 diff --git a/src/main/java/com/adyen/model/transfers/AmountAdjustment.java b/src/main/java/com/adyen/model/transfers/AmountAdjustment.java index d02e0742a..232b0574a 100644 --- a/src/main/java/com/adyen/model/transfers/AmountAdjustment.java +++ b/src/main/java/com/adyen/model/transfers/AmountAdjustment.java @@ -246,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 diff --git a/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java b/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java index e4594e196..52972b57c 100644 --- a/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java +++ b/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java @@ -111,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 diff --git a/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java index 144cb0e4d..5bb71069a 100644 --- a/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java @@ -315,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 diff --git a/src/main/java/com/adyen/model/transfers/BalanceMutation.java b/src/main/java/com/adyen/model/transfers/BalanceMutation.java index b91c3eb29..55df98e74 100644 --- a/src/main/java/com/adyen/model/transfers/BalanceMutation.java +++ b/src/main/java/com/adyen/model/transfers/BalanceMutation.java @@ -254,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 diff --git a/src/main/java/com/adyen/model/transfers/BankAccountV3.java b/src/main/java/com/adyen/model/transfers/BankAccountV3.java index ea14c090c..9379cdd31 100644 --- a/src/main/java/com/adyen/model/transfers/BankAccountV3.java +++ b/src/main/java/com/adyen/model/transfers/BankAccountV3.java @@ -195,13 +195,23 @@ public boolean equals(Object o) { } BankAccountV3 bankAccountV3 = (BankAccountV3) o; return Objects.equals(this.accountHolder, bankAccountV3.accountHolder) + && Objects.equals(this.isSetAccountHolder, bankAccountV3.isSetAccountHolder) && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification) - && Objects.equals(this.storedPaymentMethodId, bankAccountV3.storedPaymentMethodId); + && 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, storedPaymentMethodId); + return Objects.hash( + accountHolder, + isSetAccountHolder, + accountIdentification, + isSetAccountIdentification, + storedPaymentMethodId, + isSetStoredPaymentMethodId); } @Override diff --git a/src/main/java/com/adyen/model/transfers/BankCategoryData.java b/src/main/java/com/adyen/model/transfers/BankCategoryData.java index 527bd77b8..1bcead249 100644 --- a/src/main/java/com/adyen/model/transfers/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transfers/BankCategoryData.java @@ -307,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 diff --git a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java index 068cac3d1..5325a8f1c 100644 --- a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java @@ -361,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 diff --git a/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java index 4522b55eb..442215c6d 100644 --- a/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java @@ -255,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 diff --git a/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java b/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java index bb3e61236..5e28e1f37 100644 --- a/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java +++ b/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java @@ -111,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 diff --git a/src/main/java/com/adyen/model/transfers/CapitalBalance.java b/src/main/java/com/adyen/model/transfers/CapitalBalance.java index d0bf59d1d..729e42001 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalBalance.java +++ b/src/main/java/com/adyen/model/transfers/CapitalBalance.java @@ -236,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 diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrant.java b/src/main/java/com/adyen/model/transfers/CapitalGrant.java index 92af073c4..cda663e06 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrant.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrant.java @@ -508,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 diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java b/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java index 70459e15d..79981429e 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java @@ -194,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 diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrants.java b/src/main/java/com/adyen/model/transfers/CapitalGrants.java index 52e51bb38..a1b9c31d8 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrants.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrants.java @@ -111,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 diff --git a/src/main/java/com/adyen/model/transfers/Card.java b/src/main/java/com/adyen/model/transfers/Card.java index 34c3f1854..bcbf09510 100644 --- a/src/main/java/com/adyen/model/transfers/Card.java +++ b/src/main/java/com/adyen/model/transfers/Card.java @@ -143,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 diff --git a/src/main/java/com/adyen/model/transfers/CardIdentification.java b/src/main/java/com/adyen/model/transfers/CardIdentification.java index 97fc4d3ad..c8370980f 100644 --- a/src/main/java/com/adyen/model/transfers/CardIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CardIdentification.java @@ -395,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 diff --git a/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java b/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java index 60bfeb534..116e9466c 100644 --- a/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java @@ -255,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 diff --git a/src/main/java/com/adyen/model/transfers/Counterparty.java b/src/main/java/com/adyen/model/transfers/Counterparty.java index 73972f0d2..1d02f4d09 100644 --- a/src/main/java/com/adyen/model/transfers/Counterparty.java +++ b/src/main/java/com/adyen/model/transfers/Counterparty.java @@ -206,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 diff --git a/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java b/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java index b80beb42e..e0d74dbc2 100644 --- a/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java +++ b/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java @@ -242,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 diff --git a/src/main/java/com/adyen/model/transfers/CounterpartyV3.java b/src/main/java/com/adyen/model/transfers/CounterpartyV3.java index 1dff3d7d5..57bd81164 100644 --- a/src/main/java/com/adyen/model/transfers/CounterpartyV3.java +++ b/src/main/java/com/adyen/model/transfers/CounterpartyV3.java @@ -284,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 diff --git a/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java index 549c47489..38f7b9bd7 100644 --- a/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java @@ -235,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 diff --git a/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java b/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java index dbeb2d8c7..20dd43393 100644 --- a/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java +++ b/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java @@ -243,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 diff --git a/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java b/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java index cda7d561b..5981821ac 100644 --- a/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java @@ -200,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 diff --git a/src/main/java/com/adyen/model/transfers/ExecutionDate.java b/src/main/java/com/adyen/model/transfers/ExecutionDate.java index fba85afd0..e20b135b9 100644 --- a/src/main/java/com/adyen/model/transfers/ExecutionDate.java +++ b/src/main/java/com/adyen/model/transfers/ExecutionDate.java @@ -174,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 diff --git a/src/main/java/com/adyen/model/transfers/ExternalReason.java b/src/main/java/com/adyen/model/transfers/ExternalReason.java index ce5b33864..52d443dc3 100644 --- a/src/main/java/com/adyen/model/transfers/ExternalReason.java +++ b/src/main/java/com/adyen/model/transfers/ExternalReason.java @@ -188,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 diff --git a/src/main/java/com/adyen/model/transfers/Fee.java b/src/main/java/com/adyen/model/transfers/Fee.java index 6dd6ecb78..12aa1f9e3 100644 --- a/src/main/java/com/adyen/model/transfers/Fee.java +++ b/src/main/java/com/adyen/model/transfers/Fee.java @@ -101,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 diff --git a/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java b/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java index 244d68230..04cbde9e6 100644 --- a/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java +++ b/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java @@ -156,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 diff --git a/src/main/java/com/adyen/model/transfers/FundingInstrument.java b/src/main/java/com/adyen/model/transfers/FundingInstrument.java index 3ad99878e..b68018e81 100644 --- a/src/main/java/com/adyen/model/transfers/FundingInstrument.java +++ b/src/main/java/com/adyen/model/transfers/FundingInstrument.java @@ -296,14 +296,27 @@ public boolean equals(Object o) { } 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.sourceOfFunds, fundingInstrument.sourceOfFunds); + && 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, networkPaymentReference, reference, sourceOfFunds); + return Objects.hash( + cardIdentification, + isSetCardIdentification, + networkPaymentReference, + isSetNetworkPaymentReference, + reference, + isSetReference, + sourceOfFunds, + isSetSourceOfFunds); } @Override diff --git a/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java index b60a9b398..cb959913d 100644 --- a/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java @@ -237,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 diff --git a/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java index 48eae4a44..84dcf415d 100644 --- a/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java @@ -189,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 diff --git a/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java b/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java index cd06b751e..c7c690cca 100644 --- a/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java @@ -195,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 diff --git a/src/main/java/com/adyen/model/transfers/InternalCategoryData.java b/src/main/java/com/adyen/model/transfers/InternalCategoryData.java index c2894cdf1..81e81edfe 100644 --- a/src/main/java/com/adyen/model/transfers/InternalCategoryData.java +++ b/src/main/java/com/adyen/model/transfers/InternalCategoryData.java @@ -236,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 diff --git a/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java b/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java index d88c3cbe0..87eb45f38 100644 --- a/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java @@ -355,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 diff --git a/src/main/java/com/adyen/model/transfers/InvalidField.java b/src/main/java/com/adyen/model/transfers/InvalidField.java index f09cef9d8..f2ab81bb7 100644 --- a/src/main/java/com/adyen/model/transfers/InvalidField.java +++ b/src/main/java/com/adyen/model/transfers/InvalidField.java @@ -188,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 diff --git a/src/main/java/com/adyen/model/transfers/IssuedCard.java b/src/main/java/com/adyen/model/transfers/IssuedCard.java index 4da1b877c..8ddbfb68e 100644 --- a/src/main/java/com/adyen/model/transfers/IssuedCard.java +++ b/src/main/java/com/adyen/model/transfers/IssuedCard.java @@ -661,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 diff --git a/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java b/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java index 69f777d05..04c4d3358 100644 --- a/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java +++ b/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java @@ -198,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 diff --git a/src/main/java/com/adyen/model/transfers/Leg.java b/src/main/java/com/adyen/model/transfers/Leg.java index 1876d05eb..585a75c90 100644 --- a/src/main/java/com/adyen/model/transfers/Leg.java +++ b/src/main/java/com/adyen/model/transfers/Leg.java @@ -326,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 diff --git a/src/main/java/com/adyen/model/transfers/Link.java b/src/main/java/com/adyen/model/transfers/Link.java index 6b5883fdd..34db842ac 100644 --- a/src/main/java/com/adyen/model/transfers/Link.java +++ b/src/main/java/com/adyen/model/transfers/Link.java @@ -101,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 diff --git a/src/main/java/com/adyen/model/transfers/Links.java b/src/main/java/com/adyen/model/transfers/Links.java index cf1dd3929..56d87e22c 100644 --- a/src/main/java/com/adyen/model/transfers/Links.java +++ b/src/main/java/com/adyen/model/transfers/Links.java @@ -142,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 diff --git a/src/main/java/com/adyen/model/transfers/Lodging.java b/src/main/java/com/adyen/model/transfers/Lodging.java index a6cc992d2..97767c25d 100644 --- a/src/main/java/com/adyen/model/transfers/Lodging.java +++ b/src/main/java/com/adyen/model/transfers/Lodging.java @@ -143,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 diff --git a/src/main/java/com/adyen/model/transfers/MerchantData.java b/src/main/java/com/adyen/model/transfers/MerchantData.java index 794c1299c..5fad8f6c0 100644 --- a/src/main/java/com/adyen/model/transfers/MerchantData.java +++ b/src/main/java/com/adyen/model/transfers/MerchantData.java @@ -272,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 diff --git a/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java b/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java index c18c86ea3..c7afd2d53 100644 --- a/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java +++ b/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java @@ -246,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 diff --git a/src/main/java/com/adyen/model/transfers/Modification.java b/src/main/java/com/adyen/model/transfers/Modification.java index a81f3904d..9774b2afc 100644 --- a/src/main/java/com/adyen/model/transfers/Modification.java +++ b/src/main/java/com/adyen/model/transfers/Modification.java @@ -447,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 diff --git a/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java index 446928a2e..d21f0ab66 100644 --- a/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java @@ -189,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 diff --git a/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java index 43412c13b..9d6a292fa 100644 --- a/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java @@ -201,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 diff --git a/src/main/java/com/adyen/model/transfers/NameLocation.java b/src/main/java/com/adyen/model/transfers/NameLocation.java index 012f51421..60307e0d7 100644 --- a/src/main/java/com/adyen/model/transfers/NameLocation.java +++ b/src/main/java/com/adyen/model/transfers/NameLocation.java @@ -332,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 diff --git a/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java index 54e7fd0f3..8ad3d6c54 100644 --- a/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java @@ -287,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 diff --git a/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java index b43fcc714..63f08af04 100644 --- a/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java @@ -201,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 diff --git a/src/main/java/com/adyen/model/transfers/PartyIdentification.java b/src/main/java/com/adyen/model/transfers/PartyIdentification.java index af94e1662..025a14a8a 100644 --- a/src/main/java/com/adyen/model/transfers/PartyIdentification.java +++ b/src/main/java/com/adyen/model/transfers/PartyIdentification.java @@ -564,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 diff --git a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java index 8a3cabb90..ff8adbba5 100644 --- a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java @@ -230,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 diff --git a/src/main/java/com/adyen/model/transfers/PlatformPayment.java b/src/main/java/com/adyen/model/transfers/PlatformPayment.java index bbf55b5f6..896cf96cb 100644 --- a/src/main/java/com/adyen/model/transfers/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transfers/PlatformPayment.java @@ -578,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 diff --git a/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java b/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java index 46e25c37c..94c72a1e0 100644 --- a/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java +++ b/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java @@ -162,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 diff --git a/src/main/java/com/adyen/model/transfers/Repayment.java b/src/main/java/com/adyen/model/transfers/Repayment.java index 8f37651d1..5659905bd 100644 --- a/src/main/java/com/adyen/model/transfers/Repayment.java +++ b/src/main/java/com/adyen/model/transfers/Repayment.java @@ -194,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 diff --git a/src/main/java/com/adyen/model/transfers/RepaymentTerm.java b/src/main/java/com/adyen/model/transfers/RepaymentTerm.java index bf8cfe6cd..d6bb08354 100644 --- a/src/main/java/com/adyen/model/transfers/RepaymentTerm.java +++ b/src/main/java/com/adyen/model/transfers/RepaymentTerm.java @@ -152,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 diff --git a/src/main/java/com/adyen/model/transfers/ResourceReference.java b/src/main/java/com/adyen/model/transfers/ResourceReference.java index f718d247e..e2e451ba4 100644 --- a/src/main/java/com/adyen/model/transfers/ResourceReference.java +++ b/src/main/java/com/adyen/model/transfers/ResourceReference.java @@ -188,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 diff --git a/src/main/java/com/adyen/model/transfers/RestServiceError.java b/src/main/java/com/adyen/model/transfers/RestServiceError.java index eccc3663d..c6ff3772b 100644 --- a/src/main/java/com/adyen/model/transfers/RestServiceError.java +++ b/src/main/java/com/adyen/model/transfers/RestServiceError.java @@ -459,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 diff --git a/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java b/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java index 8eaf76f8a..9ce5e82b0 100644 --- a/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java +++ b/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java @@ -167,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 diff --git a/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java b/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java index 85e02e85d..f86f1fdbc 100644 --- a/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java +++ b/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java @@ -278,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 diff --git a/src/main/java/com/adyen/model/transfers/RoutingDetails.java b/src/main/java/com/adyen/model/transfers/RoutingDetails.java index e19196fc9..190d3162d 100644 --- a/src/main/java/com/adyen/model/transfers/RoutingDetails.java +++ b/src/main/java/com/adyen/model/transfers/RoutingDetails.java @@ -355,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 diff --git a/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java index dad6c2845..dac78227c 100644 --- a/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java @@ -255,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 diff --git a/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java index d765cfab6..350b8ba69 100644 --- a/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java @@ -231,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 diff --git a/src/main/java/com/adyen/model/transfers/ServiceError.java b/src/main/java/com/adyen/model/transfers/ServiceError.java index 3605e106c..2c88c1a89 100644 --- a/src/main/java/com/adyen/model/transfers/ServiceError.java +++ b/src/main/java/com/adyen/model/transfers/ServiceError.java @@ -272,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 diff --git a/src/main/java/com/adyen/model/transfers/ThreeDSecure.java b/src/main/java/com/adyen/model/transfers/ThreeDSecure.java index 29d3a0ad8..08495476f 100644 --- a/src/main/java/com/adyen/model/transfers/ThreeDSecure.java +++ b/src/main/java/com/adyen/model/transfers/ThreeDSecure.java @@ -101,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 diff --git a/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java b/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java index c1f7d4bfe..e0807837b 100644 --- a/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java +++ b/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java @@ -101,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 diff --git a/src/main/java/com/adyen/model/transfers/Transaction.java b/src/main/java/com/adyen/model/transfers/Transaction.java index 154d0bdca..989ac5391 100644 --- a/src/main/java/com/adyen/model/transfers/Transaction.java +++ b/src/main/java/com/adyen/model/transfers/Transaction.java @@ -696,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 diff --git a/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java b/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java index b0f0a562c..b97ae7297 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java +++ b/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java @@ -189,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 diff --git a/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java b/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java index f0e3f97ae..bb51d05ed 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java @@ -278,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 diff --git a/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java b/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java index 8850739ab..135ab9c7d 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java @@ -164,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 diff --git a/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java b/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java index 8018d4b8f..436f03884 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java @@ -250,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) && Objects.equals( - this.triggeredTransactionRules, transactionRulesResult.triggeredTransactionRules); + 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 diff --git a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java index a0c6f3ef2..d8b2ecae8 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java +++ b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java @@ -156,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 diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index e36e9c67e..e483cdd5e 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -1554,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferData.java b/src/main/java/com/adyen/model/transfers/TransferData.java index 5d549af2e..060a6eaad 100644 --- a/src/main/java/com/adyen/model/transfers/TransferData.java +++ b/src/main/java/com/adyen/model/transfers/TransferData.java @@ -1974,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferEvent.java b/src/main/java/com/adyen/model/transfers/TransferEvent.java index 3c4ec635e..20a73764c 100644 --- a/src/main/java/com/adyen/model/transfers/TransferEvent.java +++ b/src/main/java/com/adyen/model/transfers/TransferEvent.java @@ -1173,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferInfo.java b/src/main/java/com/adyen/model/transfers/TransferInfo.java index 5f2a3e7c0..81513f1dc 100644 --- a/src/main/java/com/adyen/model/transfers/TransferInfo.java +++ b/src/main/java/com/adyen/model/transfers/TransferInfo.java @@ -1217,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java b/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java index ca94ac8ce..f30bc2af3 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java @@ -290,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java b/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java index 1858c7eae..1ee863bea 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java @@ -364,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java index 3e2b75497..3e0af60d3 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java @@ -149,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferRequestReview.java b/src/main/java/com/adyen/model/transfers/TransferRequestReview.java index db44f425e..3a6d88127 100644 --- a/src/main/java/com/adyen/model/transfers/TransferRequestReview.java +++ b/src/main/java/com/adyen/model/transfers/TransferRequestReview.java @@ -181,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferReview.java b/src/main/java/com/adyen/model/transfers/TransferReview.java index 8000590c4..1934c9795 100644 --- a/src/main/java/com/adyen/model/transfers/TransferReview.java +++ b/src/main/java/com/adyen/model/transfers/TransferReview.java @@ -215,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java b/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java index 85fea0eb8..8d2be0be8 100644 --- a/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java +++ b/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java @@ -526,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 diff --git a/src/main/java/com/adyen/model/transfers/TransferView.java b/src/main/java/com/adyen/model/transfers/TransferView.java index 455b36890..41458ce7a 100644 --- a/src/main/java/com/adyen/model/transfers/TransferView.java +++ b/src/main/java/com/adyen/model/transfers/TransferView.java @@ -206,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 diff --git a/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java index 60cfad17e..1db60eb9e 100644 --- a/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java @@ -237,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 diff --git a/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java index b8e432d75..6e4f99962 100644 --- a/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java @@ -328,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 diff --git a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java index eb9b15392..73c108bb5 100644 --- a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java +++ b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java @@ -606,30 +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, + isSetAddress, dateOfBirth, + isSetDateOfBirth, email, + isSetEmail, firstName, + isSetFirstName, fullName, + isSetFullName, fundingInstrument, + isSetFundingInstrument, lastName, + isSetLastName, reference, + isSetReference, type, - url); + isSetType, + url, + isSetUrl); } @Override From f858418005ba996d6ec8e958bf97549b280b02e8 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Wed, 10 Dec 2025 11:24:13 +0100 Subject: [PATCH 4/4] Regenerate Webhook models --- .../AULocalAccountIdentification.java | 73 ----- .../AdditionalBankIdentification.java | 65 ---- .../adyen/model/transferwebhooks/Address.java | 97 ------ .../adyen/model/transferwebhooks/Airline.java | 65 ---- .../adyen/model/transferwebhooks/Amount.java | 65 ---- .../transferwebhooks/AmountAdjustment.java | 73 ----- .../BRLocalAccountIdentification.java | 89 ------ .../transferwebhooks/BalanceMutation.java | 81 ----- .../BalancePlatformNotificationResponse.java | 57 ---- .../model/transferwebhooks/BankAccountV3.java | 73 ----- .../transferwebhooks/BankCategoryData.java | 65 ---- .../CALocalAccountIdentification.java | 89 ------ .../CZLocalAccountIdentification.java | 73 ----- .../adyen/model/transferwebhooks/Card.java | 65 ---- .../transferwebhooks/CardIdentification.java | 105 ------- .../ConfirmationTrackingData.java | 65 ---- .../transferwebhooks/CounterpartyV3.java | 89 ------ .../DKLocalAccountIdentification.java | 73 ----- .../DirectDebitInformation.java | 81 ----- .../EstimationTrackingData.java | 65 ---- .../model/transferwebhooks/ExecutionDate.java | 65 ---- .../transferwebhooks/ExternalReason.java | 73 ----- .../HKLocalAccountIdentification.java | 73 ----- .../HULocalAccountIdentification.java | 65 ---- .../IbanAccountIdentification.java | 65 ---- .../InternalCategoryData.java | 74 ----- .../InternalReviewTrackingData.java | 73 ----- .../model/transferwebhooks/IssuedCard.java | 121 -------- .../IssuingTransactionData.java | 65 ---- .../com/adyen/model/transferwebhooks/Leg.java | 97 ------ .../adyen/model/transferwebhooks/Lodging.java | 65 ---- .../model/transferwebhooks/MerchantData.java | 89 ------ .../MerchantPurchaseData.java | 73 ----- .../model/transferwebhooks/Modification.java | 89 ------ .../NOLocalAccountIdentification.java | 65 ---- .../NZLocalAccountIdentification.java | 65 ---- .../model/transferwebhooks/NameLocation.java | 97 ------ .../NumberAndBicAccountIdentification.java | 82 ----- .../PLLocalAccountIdentification.java | 65 ---- .../transferwebhooks/PartyIdentification.java | 121 -------- .../transferwebhooks/PaymentInstrument.java | 81 ----- .../transferwebhooks/PlatformPayment.java | 98 ------ .../RelayedAuthorisationData.java | 65 ---- .../model/transferwebhooks/Resource.java | 73 ----- .../transferwebhooks/ResourceReference.java | 73 ----- .../SELocalAccountIdentification.java | 73 ----- .../SGLocalAccountIdentification.java | 73 ----- .../model/transferwebhooks/ThreeDSecure.java | 57 ---- .../TransactionEventViolation.java | 73 ----- .../TransactionRuleReference.java | 89 ------ .../TransactionRuleSource.java | 65 ---- .../TransactionRulesResult.java | 81 ----- .../model/transferwebhooks/TransferData.java | 281 ------------------ .../model/transferwebhooks/TransferEvent.java | 193 ------------ .../TransferNotificationCounterParty.java | 89 ------ .../TransferNotificationMerchantData.java | 105 ------- .../TransferNotificationRequest.java | 81 ----- .../TransferNotificationValidationFact.java | 65 ---- .../transferwebhooks/TransferReview.java | 65 ---- .../UKLocalAccountIdentification.java | 73 ----- .../USLocalAccountIdentification.java | 81 ----- 61 files changed, 5024 deletions(-) diff --git a/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java index 89cc0a70a..840af2718 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +31,9 @@ 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")); @@ -84,15 +76,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public AULocalAccountIdentification() {} /** @@ -103,7 +86,6 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -127,7 +109,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -140,7 +121,6 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; - isSetBsbCode = true; // mark as set return this; } @@ -168,7 +148,6 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; - isSetBsbCode = true; // mark as set } /** @@ -179,7 +158,6 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -203,27 +181,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -267,36 +224,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetBsbCode) { - addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java index 4cde8b42e..2cd17d0bb 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +30,6 @@ 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) @@ -94,15 +89,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public AdditionalBankIdentification() {} /** @@ -113,7 +99,6 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; - isSetCode = true; // mark as set return this; } @@ -137,7 +122,6 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; - isSetCode = true; // mark as set } /** @@ -166,7 +150,6 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -226,27 +209,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -288,33 +250,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCode) { - addIfNull(nulls, JSON_PROPERTY_CODE, this.code); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Address.java b/src/main/java/com/adyen/model/transferwebhooks/Address.java index 40b75cec1..d7ed7cc91 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Address.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Address.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,45 +30,21 @@ 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() {} /** @@ -83,7 +57,6 @@ public Address() {} */ public Address city(String city) { this.city = city; - isSetCity = true; // mark as set return this; } @@ -111,7 +84,6 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; - isSetCity = true; // mark as set } /** @@ -123,7 +95,6 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; - isSetCountry = true; // mark as set return this; } @@ -149,7 +120,6 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; - isSetCountry = true; // mark as set } /** @@ -163,7 +133,6 @@ public void setCountry(String country) { */ public Address line1(String line1) { this.line1 = line1; - isSetLine1 = true; // mark as set return this; } @@ -193,7 +162,6 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; - isSetLine1 = true; // mark as set } /** @@ -207,7 +175,6 @@ public void setLine1(String line1) { */ public Address line2(String line2) { this.line2 = line2; - isSetLine2 = true; // mark as set return this; } @@ -237,7 +204,6 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; - isSetLine2 = true; // mark as set } /** @@ -252,7 +218,6 @@ public void setLine2(String line2) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; - isSetPostalCode = true; // mark as set return this; } @@ -284,7 +249,6 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; - isSetPostalCode = true; // mark as set } /** @@ -297,7 +261,6 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; - isSetStateOrProvince = true; // mark as set return this; } @@ -325,27 +288,6 @@ 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. */ @@ -395,45 +337,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCity) { - addIfNull(nulls, JSON_PROPERTY_CITY, this.city); - } - if (isSetCountry) { - addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); - } - if (isSetLine1) { - addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); - } - if (isSetLine2) { - addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); - } - if (isSetPostalCode) { - addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); - } - if (isSetStateOrProvince) { - addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Address given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Airline.java b/src/main/java/com/adyen/model/transferwebhooks/Airline.java index 081cbcbcf..bfe6ad80c 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Airline.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Airline.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,21 +25,9 @@ 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() {} /** @@ -52,7 +38,6 @@ public Airline() {} */ public Airline legs(List legs) { this.legs = legs; - isSetLegs = true; // mark as set return this; } @@ -84,7 +69,6 @@ public List getLegs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegs(List legs) { this.legs = legs; - isSetLegs = true; // mark as set } /** @@ -95,7 +79,6 @@ public void setLegs(List legs) { */ public Airline ticketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; - isSetTicketNumber = true; // mark as set return this; } @@ -119,27 +102,6 @@ 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. */ @@ -181,33 +143,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetLegs) { - addIfNull(nulls, JSON_PROPERTY_LEGS, this.legs); - } - if (isSetTicketNumber) { - addIfNull(nulls, JSON_PROPERTY_TICKET_NUMBER, this.ticketNumber); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Airline given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Amount.java b/src/main/java/com/adyen/model/transferwebhooks/Amount.java index 8ab4878a5..0cd70f18a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Amount.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,21 +23,9 @@ public class Amount { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCurrency = false; - public static final String JSON_PROPERTY_VALUE = "value"; private Long value; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetValue = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public Amount() {} /** @@ -54,7 +40,6 @@ public Amount() {} */ public Amount currency(String currency) { this.currency = currency; - isSetCurrency = true; // mark as set return this; } @@ -86,7 +71,6 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; - isSetCurrency = true; // mark as set } /** @@ -99,7 +83,6 @@ public void setCurrency(String currency) { */ public Amount value(Long value) { this.value = value; - isSetValue = true; // mark as set return this; } @@ -127,27 +110,6 @@ public Long getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; - isSetValue = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public Amount includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this Amount object is equal to o. */ @@ -189,33 +151,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCurrency) { - addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); - } - if (isSetValue) { - addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Amount given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java b/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java index da40d7add..00fff8f3a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +31,6 @@ 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**. @@ -87,21 +82,9 @@ 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() {} /** @@ -112,7 +95,6 @@ public AmountAdjustment() {} */ public AmountAdjustment amount(Amount amount) { this.amount = amount; - isSetAmount = true; // mark as set return this; } @@ -136,7 +118,6 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; - isSetAmount = true; // mark as set } /** @@ -149,7 +130,6 @@ public void setAmount(Amount amount) { */ public AmountAdjustment amountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; - isSetAmountAdjustmentType = true; // mark as set return this; } @@ -177,7 +157,6 @@ public AmountAdjustmentTypeEnum getAmountAdjustmentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; - isSetAmountAdjustmentType = true; // mark as set } /** @@ -188,7 +167,6 @@ public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentTyp */ public AmountAdjustment basepoints(Integer basepoints) { this.basepoints = basepoints; - isSetBasepoints = true; // mark as set return this; } @@ -212,27 +190,6 @@ 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. */ @@ -278,36 +235,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAmount) { - addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); - } - if (isSetAmountAdjustmentType) { - addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE, this.amountAdjustmentType); - } - if (isSetBasepoints) { - addIfNull(nulls, JSON_PROPERTY_BASEPOINTS, this.basepoints); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of AmountAdjustment given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java index 9524de997..12730df5f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,27 +33,15 @@ 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")); @@ -98,15 +84,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public BRLocalAccountIdentification() {} /** @@ -117,7 +94,6 @@ public BRLocalAccountIdentification() {} */ public BRLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -141,7 +117,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -152,7 +127,6 @@ public void setAccountNumber(String accountNumber) { */ public BRLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; - isSetBankCode = true; // mark as set return this; } @@ -176,7 +150,6 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; - isSetBankCode = true; // mark as set } /** @@ -187,7 +160,6 @@ public void setBankCode(String bankCode) { */ public BRLocalAccountIdentification branchNumber(String branchNumber) { this.branchNumber = branchNumber; - isSetBranchNumber = true; // mark as set return this; } @@ -211,7 +183,6 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; - isSetBranchNumber = true; // mark as set } /** @@ -222,7 +193,6 @@ public void setBranchNumber(String branchNumber) { */ public BRLocalAccountIdentification ispb(String ispb) { this.ispb = ispb; - isSetIspb = true; // mark as set return this; } @@ -246,7 +216,6 @@ public String getIspb() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIspb(String ispb) { this.ispb = ispb; - isSetIspb = true; // mark as set } /** @@ -257,7 +226,6 @@ public void setIspb(String ispb) { */ public BRLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -281,27 +249,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -349,42 +296,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetBankCode) { - addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); - } - if (isSetBranchNumber) { - addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); - } - if (isSetIspb) { - addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of BRLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java b/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java index d87139c76..a23e484bf 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,33 +28,15 @@ 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() {} /** @@ -69,7 +49,6 @@ public BalanceMutation() {} */ public BalanceMutation balance(Long balance) { this.balance = balance; - isSetBalance = true; // mark as set return this; } @@ -97,7 +76,6 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; - isSetBalance = true; // mark as set } /** @@ -110,7 +88,6 @@ public void setBalance(Long balance) { */ public BalanceMutation currency(String currency) { this.currency = currency; - isSetCurrency = true; // mark as set return this; } @@ -138,7 +115,6 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; - isSetCurrency = true; // mark as set } /** @@ -151,7 +127,6 @@ public void setCurrency(String currency) { */ public BalanceMutation received(Long received) { this.received = received; - isSetReceived = true; // mark as set return this; } @@ -179,7 +154,6 @@ public Long getReceived() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceived(Long received) { this.received = received; - isSetReceived = true; // mark as set } /** @@ -192,7 +166,6 @@ public void setReceived(Long received) { */ public BalanceMutation reserved(Long reserved) { this.reserved = reserved; - isSetReserved = true; // mark as set return this; } @@ -220,27 +193,6 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; - isSetReserved = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -286,39 +238,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetBalance) { - addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); - } - if (isSetCurrency) { - addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); - } - if (isSetReceived) { - addIfNull(nulls, JSON_PROPERTY_RECEIVED, this.received); - } - if (isSetReserved) { - addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of BalanceMutation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java index b42e64b6a..6f13538f7 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,15 +23,6 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetNotificationResponse = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public BalancePlatformNotificationResponse() {} /** @@ -47,7 +36,6 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; - isSetNotificationResponse = true; // mark as set return this; } @@ -75,27 +63,6 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; - isSetNotificationResponse = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -139,30 +106,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetNotificationResponse) { - addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java index 1b8c50b46..53e309721 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,27 +27,12 @@ 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() {} /** @@ -60,7 +43,6 @@ public BankAccountV3() {} */ public BankAccountV3 accountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; - isSetAccountHolder = true; // mark as set return this; } @@ -84,7 +66,6 @@ public PartyIdentification getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; - isSetAccountHolder = true; // mark as set } /** @@ -96,7 +77,6 @@ public void setAccountHolder(PartyIdentification accountHolder) { public BankAccountV3 accountIdentification( BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; - isSetAccountIdentification = true; // mark as set return this; } @@ -120,7 +100,6 @@ public BankAccountV3AccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; - isSetAccountIdentification = true; // mark as set } /** @@ -133,7 +112,6 @@ public void setAccountIdentification(BankAccountV3AccountIdentification accountI */ public BankAccountV3 storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; - isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -161,27 +139,6 @@ 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 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. */ @@ -229,36 +186,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountHolder) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); - } - if (isSetAccountIdentification) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); - } - if (isSetStoredPaymentMethodId) { - addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of BankAccountV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java b/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java index 01eef6886..8365dfedd 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -90,9 +88,6 @@ 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")); @@ -135,15 +130,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public BankCategoryData() {} /** @@ -174,7 +160,6 @@ public BankCategoryData() {} */ public BankCategoryData priority(PriorityEnum priority) { this.priority = priority; - isSetPriority = true; // mark as set return this; } @@ -238,7 +223,6 @@ public PriorityEnum getPriority() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; - isSetPriority = true; // mark as set } /** @@ -249,7 +233,6 @@ public void setPriority(PriorityEnum priority) { */ public BankCategoryData type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -273,27 +256,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -335,33 +297,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetPriority) { - addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of BankCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java index 3f7201441..e1c0ce47d 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +33,6 @@ 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**. */ @@ -84,21 +79,12 @@ 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")); @@ -141,15 +127,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public CALocalAccountIdentification() {} /** @@ -160,7 +137,6 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -184,7 +160,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -196,7 +171,6 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; - isSetAccountType = true; // mark as set return this; } @@ -222,7 +196,6 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; - isSetAccountType = true; // mark as set } /** @@ -233,7 +206,6 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; - isSetInstitutionNumber = true; // mark as set return this; } @@ -257,7 +229,6 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; - isSetInstitutionNumber = true; // mark as set } /** @@ -268,7 +239,6 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; - isSetTransitNumber = true; // mark as set return this; } @@ -292,7 +262,6 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; - isSetTransitNumber = true; // mark as set } /** @@ -303,7 +272,6 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -327,27 +295,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -395,42 +342,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetAccountType) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); - } - if (isSetInstitutionNumber) { - addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); - } - if (isSetTransitNumber) { - addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java index 54aa9a127..a46f58f0b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +31,9 @@ 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")); @@ -84,15 +76,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public CZLocalAccountIdentification() {} /** @@ -111,7 +94,6 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -151,7 +133,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -162,7 +143,6 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; - isSetBankCode = true; // mark as set return this; } @@ -186,7 +166,6 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; - isSetBankCode = true; // mark as set } /** @@ -197,7 +176,6 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -221,27 +199,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -285,36 +242,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetBankCode) { - addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Card.java b/src/main/java/com/adyen/model/transferwebhooks/Card.java index 6cc9b982d..f7fe6a73b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Card.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Card.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,21 +23,9 @@ 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() {} /** @@ -50,7 +36,6 @@ public Card() {} */ public Card cardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; - isSetCardHolder = true; // mark as set return this; } @@ -74,7 +59,6 @@ public PartyIdentification getCardHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; - isSetCardHolder = true; // mark as set } /** @@ -85,7 +69,6 @@ public void setCardHolder(PartyIdentification cardHolder) { */ public Card cardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; - isSetCardIdentification = true; // mark as set return this; } @@ -109,27 +92,6 @@ 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. */ @@ -171,33 +133,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCardHolder) { - addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER, this.cardHolder); - } - if (isSetCardIdentification) { - addIfNull(nulls, JSON_PROPERTY_CARD_IDENTIFICATION, this.cardIdentification); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Card given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java index c75293338..5b6e43a02 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,51 +31,24 @@ 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() {} /** @@ -90,7 +61,6 @@ public CardIdentification() {} */ public CardIdentification expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; - isSetExpiryMonth = true; // mark as set return this; } @@ -118,7 +88,6 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; - isSetExpiryMonth = true; // mark as set } /** @@ -129,7 +98,6 @@ public void setExpiryMonth(String expiryMonth) { */ public CardIdentification expiryYear(String expiryYear) { this.expiryYear = expiryYear; - isSetExpiryYear = true; // mark as set return this; } @@ -153,7 +121,6 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; - isSetExpiryYear = true; // mark as set } /** @@ -164,7 +131,6 @@ public void setExpiryYear(String expiryYear) { */ public CardIdentification issueNumber(String issueNumber) { this.issueNumber = issueNumber; - isSetIssueNumber = true; // mark as set return this; } @@ -188,7 +154,6 @@ public String getIssueNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueNumber(String issueNumber) { this.issueNumber = issueNumber; - isSetIssueNumber = true; // mark as set } /** @@ -201,7 +166,6 @@ public void setIssueNumber(String issueNumber) { */ public CardIdentification number(String number) { this.number = number; - isSetNumber = true; // mark as set return this; } @@ -229,7 +193,6 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; - isSetNumber = true; // mark as set } /** @@ -243,7 +206,6 @@ public void setNumber(String number) { */ public CardIdentification startMonth(String startMonth) { this.startMonth = startMonth; - isSetStartMonth = true; // mark as set return this; } @@ -273,7 +235,6 @@ public String getStartMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartMonth(String startMonth) { this.startMonth = startMonth; - isSetStartMonth = true; // mark as set } /** @@ -286,7 +247,6 @@ public void setStartMonth(String startMonth) { */ public CardIdentification startYear(String startYear) { this.startYear = startYear; - isSetStartYear = true; // mark as set return this; } @@ -314,7 +274,6 @@ public String getStartYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartYear(String startYear) { this.startYear = startYear; - isSetStartYear = true; // mark as set } /** @@ -329,7 +288,6 @@ public void setStartYear(String startYear) { */ public CardIdentification storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; - isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -361,27 +319,6 @@ 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. */ @@ -436,48 +373,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetExpiryMonth) { - addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); - } - if (isSetExpiryYear) { - addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); - } - if (isSetIssueNumber) { - addIfNull(nulls, JSON_PROPERTY_ISSUE_NUMBER, this.issueNumber); - } - if (isSetNumber) { - addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); - } - if (isSetStartMonth) { - addIfNull(nulls, JSON_PROPERTY_START_MONTH, this.startMonth); - } - if (isSetStartYear) { - addIfNull(nulls, JSON_PROPERTY_START_YEAR, this.startYear); - } - if (isSetStoredPaymentMethodId) { - addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of CardIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java index bd352549c..37c66d92c 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -77,9 +75,6 @@ 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. @@ -125,15 +120,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public ConfirmationTrackingData() {} /** @@ -148,7 +134,6 @@ public ConfirmationTrackingData() {} */ public ConfirmationTrackingData status(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set return this; } @@ -180,7 +165,6 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set } /** @@ -193,7 +177,6 @@ public void setStatus(StatusEnum status) { */ public ConfirmationTrackingData type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -221,27 +204,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -283,33 +245,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetStatus) { - addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of ConfirmationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java b/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java index aeeed2dba..bb8a1a793 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,39 +29,18 @@ 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() {} /** @@ -76,7 +53,6 @@ public CounterpartyV3() {} */ public CounterpartyV3 balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; - isSetBalanceAccountId = true; // mark as set return this; } @@ -104,7 +80,6 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; - isSetBalanceAccountId = true; // mark as set } /** @@ -115,7 +90,6 @@ public void setBalanceAccountId(String balanceAccountId) { */ public CounterpartyV3 bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; - isSetBankAccount = true; // mark as set return this; } @@ -139,7 +113,6 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; - isSetBankAccount = true; // mark as set } /** @@ -150,7 +123,6 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public CounterpartyV3 card(Card card) { this.card = card; - isSetCard = true; // mark as set return this; } @@ -174,7 +146,6 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; - isSetCard = true; // mark as set } /** @@ -185,7 +156,6 @@ public void setCard(Card card) { */ public CounterpartyV3 merchant(MerchantData merchant) { this.merchant = merchant; - isSetMerchant = true; // mark as set return this; } @@ -209,7 +179,6 @@ public MerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(MerchantData merchant) { this.merchant = merchant; - isSetMerchant = true; // mark as set } /** @@ -222,7 +191,6 @@ public void setMerchant(MerchantData merchant) { */ public CounterpartyV3 transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; - isSetTransferInstrumentId = true; // mark as set return this; } @@ -250,27 +218,6 @@ 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. */ @@ -320,42 +267,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetBalanceAccountId) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); - } - if (isSetBankAccount) { - addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); - } - if (isSetCard) { - addIfNull(nulls, JSON_PROPERTY_CARD, this.card); - } - if (isSetMerchant) { - addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); - } - if (isSetTransferInstrumentId) { - addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of CounterpartyV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java index f735d25d2..86a651b02 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +31,9 @@ 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")); @@ -84,15 +76,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public DKLocalAccountIdentification() {} /** @@ -104,7 +87,6 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -130,7 +112,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -141,7 +122,6 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; - isSetBankCode = true; // mark as set return this; } @@ -166,7 +146,6 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; - isSetBankCode = true; // mark as set } /** @@ -177,7 +156,6 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -201,27 +179,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -265,36 +222,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetBankCode) { - addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java b/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java index dd775cadd..c4944dac4 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,33 +29,15 @@ 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() {} /** @@ -70,7 +50,6 @@ public DirectDebitInformation() {} */ public DirectDebitInformation dateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; - isSetDateOfSignature = true; // mark as set return this; } @@ -98,7 +77,6 @@ public OffsetDateTime getDateOfSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; - isSetDateOfSignature = true; // mark as set } /** @@ -109,7 +87,6 @@ public void setDateOfSignature(OffsetDateTime dateOfSignature) { */ public DirectDebitInformation dueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; - isSetDueDate = true; // mark as set return this; } @@ -133,7 +110,6 @@ public OffsetDateTime getDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; - isSetDueDate = true; // mark as set } /** @@ -144,7 +120,6 @@ public void setDueDate(OffsetDateTime dueDate) { */ public DirectDebitInformation mandateId(String mandateId) { this.mandateId = mandateId; - isSetMandateId = true; // mark as set return this; } @@ -168,7 +143,6 @@ public String getMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandateId(String mandateId) { this.mandateId = mandateId; - isSetMandateId = true; // mark as set } /** @@ -181,7 +155,6 @@ public void setMandateId(String mandateId) { */ public DirectDebitInformation sequenceType(String sequenceType) { this.sequenceType = sequenceType; - isSetSequenceType = true; // mark as set return this; } @@ -209,27 +182,6 @@ 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. */ @@ -275,39 +227,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetDateOfSignature) { - addIfNull(nulls, JSON_PROPERTY_DATE_OF_SIGNATURE, this.dateOfSignature); - } - if (isSetDueDate) { - addIfNull(nulls, JSON_PROPERTY_DUE_DATE, this.dueDate); - } - if (isSetMandateId) { - addIfNull(nulls, JSON_PROPERTY_MANDATE_ID, this.mandateId); - } - if (isSetSequenceType) { - addIfNull(nulls, JSON_PROPERTY_SEQUENCE_TYPE, this.sequenceType); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of DirectDebitInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java index 00aec15d8..15e7f11e8 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +31,6 @@ 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. @@ -81,15 +76,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public EstimationTrackingData() {} /** @@ -100,7 +86,6 @@ public EstimationTrackingData() {} */ public EstimationTrackingData estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; - isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -125,7 +110,6 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; - isSetEstimatedArrivalTime = true; // mark as set } /** @@ -138,7 +122,6 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public EstimationTrackingData type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -166,27 +149,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -230,33 +192,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetEstimatedArrivalTime) { - addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of EstimationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java b/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java index 92c5e7bb6..7590e2320 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,21 +24,9 @@ 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() {} /** @@ -57,7 +43,6 @@ public ExecutionDate() {} */ public ExecutionDate date(LocalDate date) { this.date = date; - isSetDate = true; // mark as set return this; } @@ -93,7 +78,6 @@ public LocalDate getDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDate(LocalDate date) { this.date = date; - isSetDate = true; // mark as set } /** @@ -108,7 +92,6 @@ public void setDate(LocalDate date) { */ public ExecutionDate timezone(String timezone) { this.timezone = timezone; - isSetTimezone = true; // mark as set return this; } @@ -140,27 +123,6 @@ 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. */ @@ -202,33 +164,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetDate) { - addIfNull(nulls, JSON_PROPERTY_DATE, this.date); - } - if (isSetTimezone) { - addIfNull(nulls, JSON_PROPERTY_TIMEZONE, this.timezone); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of ExecutionDate given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java b/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java index d0763e79b..23eb589fe 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,27 +27,12 @@ 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() {} /** @@ -60,7 +43,6 @@ public ExternalReason() {} */ public ExternalReason code(String code) { this.code = code; - isSetCode = true; // mark as set return this; } @@ -84,7 +66,6 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; - isSetCode = true; // mark as set } /** @@ -95,7 +76,6 @@ public void setCode(String code) { */ public ExternalReason description(String description) { this.description = description; - isSetDescription = true; // mark as set return this; } @@ -119,7 +99,6 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; - isSetDescription = true; // mark as set } /** @@ -130,7 +109,6 @@ public void setDescription(String description) { */ public ExternalReason namespace(String namespace) { this.namespace = namespace; - isSetNamespace = true; // mark as set return this; } @@ -154,27 +132,6 @@ 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. */ @@ -218,36 +175,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCode) { - addIfNull(nulls, JSON_PROPERTY_CODE, this.code); - } - if (isSetDescription) { - addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); - } - if (isSetNamespace) { - addIfNull(nulls, JSON_PROPERTY_NAMESPACE, this.namespace); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of ExternalReason given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java index c76a1dfc5..01fcbfd81 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +31,9 @@ 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")); @@ -84,15 +76,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public HKLocalAccountIdentification() {} /** @@ -105,7 +88,6 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -133,7 +115,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -144,7 +125,6 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; - isSetClearingCode = true; // mark as set return this; } @@ -168,7 +148,6 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; - isSetClearingCode = true; // mark as set } /** @@ -179,7 +158,6 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -203,27 +181,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -267,36 +224,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetClearingCode) { - addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java index e20f05d41..fccfad5ec 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +30,6 @@ 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")); @@ -77,15 +72,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public HULocalAccountIdentification() {} /** @@ -96,7 +82,6 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -120,7 +105,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -131,7 +115,6 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -155,27 +138,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -217,33 +179,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java index 60a3b8e2a..3d44f7cc4 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +30,6 @@ 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")); @@ -77,15 +72,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public IbanAccountIdentification() {} /** @@ -98,7 +84,6 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; - isSetIban = true; // mark as set return this; } @@ -126,7 +111,6 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; - isSetIban = true; // mark as set } /** @@ -137,7 +121,6 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -161,27 +144,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -223,33 +185,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetIban) { - addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java b/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java index 1cdbf7fff..3139106aa 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,15 +32,9 @@ 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")); @@ -85,15 +77,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public InternalCategoryData() {} /** @@ -105,7 +88,6 @@ public InternalCategoryData() {} */ public InternalCategoryData modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; - isSetModificationMerchantReference = true; // mark as set return this; } @@ -131,7 +113,6 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; - isSetModificationMerchantReference = true; // mark as set } /** @@ -142,7 +123,6 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public InternalCategoryData modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; - isSetModificationPspReference = true; // mark as set return this; } @@ -166,7 +146,6 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; - isSetModificationPspReference = true; // mark as set } /** @@ -177,7 +156,6 @@ public void setModificationPspReference(String modificationPspReference) { */ public InternalCategoryData type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -201,27 +179,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -271,37 +228,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetModificationMerchantReference) { - addIfNull( - nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); - } - if (isSetModificationPspReference) { - addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of InternalCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java index f5b519c8b..a67616193 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -76,9 +74,6 @@ 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, @@ -127,9 +122,6 @@ 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. @@ -175,15 +167,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public InternalReviewTrackingData() {} /** @@ -199,7 +182,6 @@ public InternalReviewTrackingData() {} */ public InternalReviewTrackingData reason(ReasonEnum reason) { this.reason = reason; - isSetReason = true; // mark as set return this; } @@ -233,7 +215,6 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; - isSetReason = true; // mark as set } /** @@ -248,7 +229,6 @@ public void setReason(ReasonEnum reason) { */ public InternalReviewTrackingData status(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set return this; } @@ -280,7 +260,6 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set } /** @@ -293,7 +272,6 @@ public void setStatus(StatusEnum status) { */ public InternalReviewTrackingData type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -321,27 +299,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -385,36 +342,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetReason) { - addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); - } - if (isSetStatus) { - addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of InternalReviewTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java b/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java index 1cbcda685..b464f625f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -41,9 +39,6 @@ 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**. @@ -101,9 +96,6 @@ 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. @@ -163,34 +155,19 @@ 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")); @@ -233,21 +210,9 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - 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() {} /** @@ -260,7 +225,6 @@ public IssuedCard() {} */ public IssuedCard authorisationType(String authorisationType) { this.authorisationType = authorisationType; - isSetAuthorisationType = true; // mark as set return this; } @@ -288,7 +252,6 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; - isSetAuthorisationType = true; // mark as set } /** @@ -302,7 +265,6 @@ public void setAuthorisationType(String authorisationType) { */ public IssuedCard panEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; - isSetPanEntryMode = true; // mark as set return this; } @@ -332,7 +294,6 @@ public PanEntryModeEnum getPanEntryMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPanEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; - isSetPanEntryMode = true; // mark as set } /** @@ -345,7 +306,6 @@ public void setPanEntryMode(PanEntryModeEnum panEntryMode) { */ public IssuedCard processingType(ProcessingTypeEnum processingType) { this.processingType = processingType; - isSetProcessingType = true; // mark as set return this; } @@ -373,7 +333,6 @@ public ProcessingTypeEnum getProcessingType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingType(ProcessingTypeEnum processingType) { this.processingType = processingType; - isSetProcessingType = true; // mark as set } /** @@ -384,7 +343,6 @@ public void setProcessingType(ProcessingTypeEnum processingType) { */ public IssuedCard relayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; - isSetRelayedAuthorisationData = true; // mark as set return this; } @@ -408,7 +366,6 @@ public RelayedAuthorisationData getRelayedAuthorisationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; - isSetRelayedAuthorisationData = true; // mark as set } /** @@ -427,7 +384,6 @@ public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthoris */ public IssuedCard schemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; - isSetSchemeTraceId = true; // mark as set return this; } @@ -467,7 +423,6 @@ public String getSchemeTraceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; - isSetSchemeTraceId = true; // mark as set } /** @@ -480,7 +435,6 @@ public void setSchemeTraceId(String schemeTraceId) { */ public IssuedCard schemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; - isSetSchemeUniqueTransactionId = true; // mark as set return this; } @@ -508,7 +462,6 @@ public String getSchemeUniqueTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; - isSetSchemeUniqueTransactionId = true; // mark as set } /** @@ -519,7 +472,6 @@ public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { */ public IssuedCard threeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; - isSetThreeDSecure = true; // mark as set return this; } @@ -543,7 +495,6 @@ public ThreeDSecure getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; - isSetThreeDSecure = true; // mark as set } /** @@ -554,7 +505,6 @@ public void setThreeDSecure(ThreeDSecure threeDSecure) { */ public IssuedCard type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -578,7 +528,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set } /** @@ -591,7 +540,6 @@ public void setType(TypeEnum type) { */ public IssuedCard validationFacts(List validationFacts) { this.validationFacts = validationFacts; - isSetValidationFacts = true; // mark as set return this; } @@ -627,27 +575,6 @@ 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. */ @@ -716,54 +643,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAuthorisationType) { - addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); - } - if (isSetPanEntryMode) { - addIfNull(nulls, JSON_PROPERTY_PAN_ENTRY_MODE, this.panEntryMode); - } - if (isSetProcessingType) { - addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPE, this.processingType); - } - if (isSetRelayedAuthorisationData) { - addIfNull(nulls, JSON_PROPERTY_RELAYED_AUTHORISATION_DATA, this.relayedAuthorisationData); - } - if (isSetSchemeTraceId) { - addIfNull(nulls, JSON_PROPERTY_SCHEME_TRACE_ID, this.schemeTraceId); - } - if (isSetSchemeUniqueTransactionId) { - addIfNull(nulls, JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID, this.schemeUniqueTransactionId); - } - if (isSetThreeDSecure) { - addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - if (isSetValidationFacts) { - addIfNull(nulls, JSON_PROPERTY_VALIDATION_FACTS, this.validationFacts); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of IssuedCard given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java b/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java index 9f0a221a9..f290bcec6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +30,6 @@ 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 @@ -80,15 +75,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public IssuingTransactionData() {} /** @@ -99,7 +85,6 @@ public IssuingTransactionData() {} */ public IssuingTransactionData captureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; - isSetCaptureCycleId = true; // mark as set return this; } @@ -123,7 +108,6 @@ public String getCaptureCycleId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; - isSetCaptureCycleId = true; // mark as set } /** @@ -136,7 +120,6 @@ public void setCaptureCycleId(String captureCycleId) { */ public IssuingTransactionData type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -164,27 +147,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -226,33 +188,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCaptureCycleId) { - addIfNull(nulls, JSON_PROPERTY_CAPTURE_CYCLE_ID, this.captureCycleId); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of IssuingTransactionData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Leg.java b/src/main/java/com/adyen/model/transferwebhooks/Leg.java index c0af4def6..01040e074 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Leg.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Leg.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,45 +30,21 @@ 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() {} /** @@ -83,7 +57,6 @@ public Leg() {} */ public Leg arrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; - isSetArrivalAirportCode = true; // mark as set return this; } @@ -111,7 +84,6 @@ public String getArrivalAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; - isSetArrivalAirportCode = true; // mark as set } /** @@ -122,7 +94,6 @@ public void setArrivalAirportCode(String arrivalAirportCode) { */ public Leg basicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; - isSetBasicFareCode = true; // mark as set return this; } @@ -146,7 +117,6 @@ public String getBasicFareCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; - isSetBasicFareCode = true; // mark as set } /** @@ -157,7 +127,6 @@ public void setBasicFareCode(String basicFareCode) { */ public Leg carrierCode(String carrierCode) { this.carrierCode = carrierCode; - isSetCarrierCode = true; // mark as set return this; } @@ -181,7 +150,6 @@ public String getCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierCode(String carrierCode) { this.carrierCode = carrierCode; - isSetCarrierCode = true; // mark as set } /** @@ -194,7 +162,6 @@ public void setCarrierCode(String carrierCode) { */ public Leg departureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; - isSetDepartureAirportCode = true; // mark as set return this; } @@ -222,7 +189,6 @@ public String getDepartureAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; - isSetDepartureAirportCode = true; // mark as set } /** @@ -233,7 +199,6 @@ public void setDepartureAirportCode(String departureAirportCode) { */ public Leg departureDate(String departureDate) { this.departureDate = departureDate; - isSetDepartureDate = true; // mark as set return this; } @@ -257,7 +222,6 @@ public String getDepartureDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureDate(String departureDate) { this.departureDate = departureDate; - isSetDepartureDate = true; // mark as set } /** @@ -268,7 +232,6 @@ public void setDepartureDate(String departureDate) { */ public Leg flightNumber(String flightNumber) { this.flightNumber = flightNumber; - isSetFlightNumber = true; // mark as set return this; } @@ -292,27 +255,6 @@ 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. */ @@ -370,45 +312,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetArrivalAirportCode) { - addIfNull(nulls, JSON_PROPERTY_ARRIVAL_AIRPORT_CODE, this.arrivalAirportCode); - } - if (isSetBasicFareCode) { - addIfNull(nulls, JSON_PROPERTY_BASIC_FARE_CODE, this.basicFareCode); - } - if (isSetCarrierCode) { - addIfNull(nulls, JSON_PROPERTY_CARRIER_CODE, this.carrierCode); - } - if (isSetDepartureAirportCode) { - addIfNull(nulls, JSON_PROPERTY_DEPARTURE_AIRPORT_CODE, this.departureAirportCode); - } - if (isSetDepartureDate) { - addIfNull(nulls, JSON_PROPERTY_DEPARTURE_DATE, this.departureDate); - } - if (isSetFlightNumber) { - addIfNull(nulls, JSON_PROPERTY_FLIGHT_NUMBER, this.flightNumber); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Leg given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Lodging.java b/src/main/java/com/adyen/model/transferwebhooks/Lodging.java index e01d15872..c007d2416 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Lodging.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Lodging.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,21 +23,9 @@ 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() {} /** @@ -50,7 +36,6 @@ public Lodging() {} */ public Lodging checkInDate(String checkInDate) { this.checkInDate = checkInDate; - isSetCheckInDate = true; // mark as set return this; } @@ -74,7 +59,6 @@ public String getCheckInDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckInDate(String checkInDate) { this.checkInDate = checkInDate; - isSetCheckInDate = true; // mark as set } /** @@ -85,7 +69,6 @@ public void setCheckInDate(String checkInDate) { */ public Lodging numberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; - isSetNumberOfNights = true; // mark as set return this; } @@ -109,27 +92,6 @@ 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. */ @@ -171,33 +133,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCheckInDate) { - addIfNull(nulls, JSON_PROPERTY_CHECK_IN_DATE, this.checkInDate); - } - if (isSetNumberOfNights) { - addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_NIGHTS, this.numberOfNights); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Lodging given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java b/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java index 5ab75c3d1..cae5b9a6d 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,39 +29,18 @@ 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() {} /** @@ -74,7 +51,6 @@ public MerchantData() {} */ public MerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; - isSetAcquirerId = true; // mark as set return this; } @@ -98,7 +74,6 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; - isSetAcquirerId = true; // mark as set } /** @@ -109,7 +84,6 @@ public void setAcquirerId(String acquirerId) { */ public MerchantData mcc(String mcc) { this.mcc = mcc; - isSetMcc = true; // mark as set return this; } @@ -133,7 +107,6 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; - isSetMcc = true; // mark as set } /** @@ -144,7 +117,6 @@ public void setMcc(String mcc) { */ public MerchantData merchantId(String merchantId) { this.merchantId = merchantId; - isSetMerchantId = true; // mark as set return this; } @@ -168,7 +140,6 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; - isSetMerchantId = true; // mark as set } /** @@ -179,7 +150,6 @@ public void setMerchantId(String merchantId) { */ public MerchantData nameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; - isSetNameLocation = true; // mark as set return this; } @@ -203,7 +173,6 @@ public NameLocation getNameLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; - isSetNameLocation = true; // mark as set } /** @@ -214,7 +183,6 @@ public void setNameLocation(NameLocation nameLocation) { */ public MerchantData postalCode(String postalCode) { this.postalCode = postalCode; - isSetPostalCode = true; // mark as set return this; } @@ -238,27 +206,6 @@ 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. */ @@ -306,42 +253,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAcquirerId) { - addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); - } - if (isSetMcc) { - addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); - } - if (isSetMerchantId) { - addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); - } - if (isSetNameLocation) { - addIfNull(nulls, JSON_PROPERTY_NAME_LOCATION, this.nameLocation); - } - if (isSetPostalCode) { - addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of MerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java b/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java index c2f38f27e..52c0ae910 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,15 +33,9 @@ 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 */ @@ -88,15 +80,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public MerchantPurchaseData() {} /** @@ -107,7 +90,6 @@ public MerchantPurchaseData() {} */ public MerchantPurchaseData airline(Airline airline) { this.airline = airline; - isSetAirline = true; // mark as set return this; } @@ -131,7 +113,6 @@ public Airline getAirline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirline(Airline airline) { this.airline = airline; - isSetAirline = true; // mark as set } /** @@ -142,7 +123,6 @@ public void setAirline(Airline airline) { */ public MerchantPurchaseData lodging(List lodging) { this.lodging = lodging; - isSetLodging = true; // mark as set return this; } @@ -174,7 +154,6 @@ public List getLodging() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodging(List lodging) { this.lodging = lodging; - isSetLodging = true; // mark as set } /** @@ -186,7 +165,6 @@ public void setLodging(List lodging) { */ public MerchantPurchaseData type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -212,27 +190,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -276,36 +233,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAirline) { - addIfNull(nulls, JSON_PROPERTY_AIRLINE, this.airline); - } - if (isSetLodging) { - addIfNull(nulls, JSON_PROPERTY_LODGING, this.lodging); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of MerchantPurchaseData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Modification.java b/src/main/java/com/adyen/model/transferwebhooks/Modification.java index ac83af328..f7a96dd05 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Modification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Modification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +33,12 @@ 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")), @@ -224,21 +213,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; - 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() {} /** @@ -249,7 +226,6 @@ public Modification() {} */ public Modification direction(String direction) { this.direction = direction; - isSetDirection = true; // mark as set return this; } @@ -273,7 +249,6 @@ public String getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(String direction) { this.direction = direction; - isSetDirection = true; // mark as set } /** @@ -284,7 +259,6 @@ public void setDirection(String direction) { */ public Modification id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -308,7 +282,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set } /** @@ -319,7 +292,6 @@ public void setId(String id) { */ public Modification reference(String reference) { this.reference = reference; - isSetReference = true; // mark as set return this; } @@ -343,7 +315,6 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; - isSetReference = true; // mark as set } /** @@ -354,7 +325,6 @@ public void setReference(String reference) { */ public Modification status(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set return this; } @@ -378,7 +348,6 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set } /** @@ -389,7 +358,6 @@ public void setStatus(StatusEnum status) { */ public Modification type(String type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -413,27 +381,6 @@ 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. */ @@ -481,42 +428,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetDirection) { - addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetReference) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); - } - if (isSetStatus) { - addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Modification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java index 8d2f7dc1f..250b05d9b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +30,6 @@ 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")); @@ -77,15 +72,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public NOLocalAccountIdentification() {} /** @@ -96,7 +82,6 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -120,7 +105,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -131,7 +115,6 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -155,27 +138,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -217,33 +179,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java index 1225865b3..14798f3aa 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +30,6 @@ 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")); @@ -77,15 +72,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public NZLocalAccountIdentification() {} /** @@ -100,7 +86,6 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -132,7 +117,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -143,7 +127,6 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -167,27 +150,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -229,33 +191,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java b/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java index 9d85afb15..dcd9872ea 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,45 +30,21 @@ 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() {} /** @@ -81,7 +55,6 @@ public NameLocation() {} */ public NameLocation city(String city) { this.city = city; - isSetCity = true; // mark as set return this; } @@ -105,7 +78,6 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; - isSetCity = true; // mark as set } /** @@ -118,7 +90,6 @@ public void setCity(String city) { */ public NameLocation country(String country) { this.country = country; - isSetCountry = true; // mark as set return this; } @@ -146,7 +117,6 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; - isSetCountry = true; // mark as set } /** @@ -161,7 +131,6 @@ public void setCountry(String country) { */ public NameLocation countryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; - isSetCountryOfOrigin = true; // mark as set return this; } @@ -193,7 +162,6 @@ public String getCountryOfOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; - isSetCountryOfOrigin = true; // mark as set } /** @@ -204,7 +172,6 @@ public void setCountryOfOrigin(String countryOfOrigin) { */ public NameLocation name(String name) { this.name = name; - isSetName = true; // mark as set return this; } @@ -228,7 +195,6 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; - isSetName = true; // mark as set } /** @@ -239,7 +205,6 @@ public void setName(String name) { */ public NameLocation rawData(String rawData) { this.rawData = rawData; - isSetRawData = true; // mark as set return this; } @@ -263,7 +228,6 @@ public String getRawData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRawData(String rawData) { this.rawData = rawData; - isSetRawData = true; // mark as set } /** @@ -274,7 +238,6 @@ public void setRawData(String rawData) { */ public NameLocation state(String state) { this.state = state; - isSetState = true; // mark as set return this; } @@ -298,27 +261,6 @@ 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. */ @@ -368,45 +310,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCity) { - addIfNull(nulls, JSON_PROPERTY_CITY, this.city); - } - if (isSetCountry) { - addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); - } - if (isSetCountryOfOrigin) { - addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_ORIGIN, this.countryOfOrigin); - } - if (isSetName) { - addIfNull(nulls, JSON_PROPERTY_NAME, this.name); - } - if (isSetRawData) { - addIfNull(nulls, JSON_PROPERTY_RAW_DATA, this.rawData); - } - if (isSetState) { - addIfNull(nulls, JSON_PROPERTY_STATE, this.state); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of NameLocation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java index 19278e159..49ad71cb7 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,22 +32,13 @@ 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")); @@ -92,15 +81,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public NumberAndBicAccountIdentification() {} /** @@ -114,7 +94,6 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -142,7 +121,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -155,7 +133,6 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; - isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -180,7 +157,6 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; - isSetAdditionalBankIdentification = true; // mark as set } /** @@ -192,7 +168,6 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; - isSetBic = true; // mark as set return this; } @@ -216,7 +191,6 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; - isSetBic = true; // mark as set } /** @@ -228,7 +202,6 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -252,27 +225,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -323,40 +275,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetAdditionalBankIdentification) { - addIfNull( - nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); - } - if (isSetBic) { - addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java index a70add140..5cc7835eb 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +30,6 @@ 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")); @@ -77,15 +72,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public PLLocalAccountIdentification() {} /** @@ -100,7 +86,6 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -132,7 +117,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -143,7 +127,6 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -167,27 +150,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -229,33 +191,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java index de9161a5e..f4f324c6d 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -40,45 +38,24 @@ 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, @@ -129,21 +106,9 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - 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() {} /** @@ -154,7 +119,6 @@ public PartyIdentification() {} */ public PartyIdentification address(Address address) { this.address = address; - isSetAddress = true; // mark as set return this; } @@ -178,7 +142,6 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; - isSetAddress = true; // mark as set } /** @@ -192,7 +155,6 @@ public void setAddress(Address address) { */ public PartyIdentification dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; - isSetDateOfBirth = true; // mark as set return this; } @@ -222,7 +184,6 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; - isSetDateOfBirth = true; // mark as set } /** @@ -234,7 +195,6 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PartyIdentification email(String email) { this.email = email; - isSetEmail = true; // mark as set return this; } @@ -260,7 +220,6 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; - isSetEmail = true; // mark as set } /** @@ -275,7 +234,6 @@ public void setEmail(String email) { */ public PartyIdentification firstName(String firstName) { this.firstName = firstName; - isSetFirstName = true; // mark as set return this; } @@ -307,7 +265,6 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; - isSetFirstName = true; // mark as set } /** @@ -322,7 +279,6 @@ public void setFirstName(String firstName) { */ public PartyIdentification fullName(String fullName) { this.fullName = fullName; - isSetFullName = true; // mark as set return this; } @@ -354,7 +310,6 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; - isSetFullName = true; // mark as set } /** @@ -369,7 +324,6 @@ public void setFullName(String fullName) { */ public PartyIdentification lastName(String lastName) { this.lastName = lastName; - isSetLastName = true; // mark as set return this; } @@ -401,7 +355,6 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; - isSetLastName = true; // mark as set } /** @@ -416,7 +369,6 @@ public void setLastName(String lastName) { */ public PartyIdentification reference(String reference) { this.reference = reference; - isSetReference = true; // mark as set return this; } @@ -448,7 +400,6 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; - isSetReference = true; // mark as set } /** @@ -463,7 +414,6 @@ public void setReference(String reference) { */ public PartyIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -495,7 +445,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set } /** @@ -506,7 +455,6 @@ public void setType(TypeEnum type) { */ public PartyIdentification url(String url) { this.url = url; - isSetUrl = true; // mark as set return this; } @@ -530,27 +478,6 @@ 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. */ @@ -607,54 +534,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAddress) { - addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); - } - if (isSetDateOfBirth) { - addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); - } - if (isSetEmail) { - addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); - } - if (isSetFirstName) { - addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); - } - if (isSetFullName) { - addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); - } - if (isSetLastName) { - addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); - } - if (isSetReference) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - if (isSetUrl) { - addIfNull(nulls, JSON_PROPERTY_URL, this.url); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of PartyIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java index 66f8194e1..0a21fdd52 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,33 +28,15 @@ 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() {} /** @@ -67,7 +47,6 @@ public PaymentInstrument() {} */ public PaymentInstrument description(String description) { this.description = description; - isSetDescription = true; // mark as set return this; } @@ -91,7 +70,6 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; - isSetDescription = true; // mark as set } /** @@ -102,7 +80,6 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -126,7 +103,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set } /** @@ -137,7 +113,6 @@ public void setId(String id) { */ public PaymentInstrument reference(String reference) { this.reference = reference; - isSetReference = true; // mark as set return this; } @@ -161,7 +136,6 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; - isSetReference = true; // mark as set } /** @@ -172,7 +146,6 @@ public void setReference(String reference) { */ public PaymentInstrument tokenType(String tokenType) { this.tokenType = tokenType; - isSetTokenType = true; // mark as set return this; } @@ -196,27 +169,6 @@ 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. */ @@ -262,39 +214,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetDescription) { - addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetReference) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); - } - if (isSetTokenType) { - addIfNull(nulls, JSON_PROPERTY_TOKEN_TYPE, this.tokenType); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java b/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java index 15051ed69..ca0228215 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,21 +35,12 @@ 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 @@ -148,15 +137,9 @@ 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")); @@ -199,15 +182,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public PlatformPayment() {} /** @@ -219,7 +193,6 @@ public PlatformPayment() {} */ public PlatformPayment modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; - isSetModificationMerchantReference = true; // mark as set return this; } @@ -245,7 +218,6 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; - isSetModificationMerchantReference = true; // mark as set } /** @@ -256,7 +228,6 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public PlatformPayment modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; - isSetModificationPspReference = true; // mark as set return this; } @@ -280,7 +251,6 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; - isSetModificationPspReference = true; // mark as set } /** @@ -291,7 +261,6 @@ public void setModificationPspReference(String modificationPspReference) { */ public PlatformPayment paymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; - isSetPaymentMerchantReference = true; // mark as set return this; } @@ -315,7 +284,6 @@ public String getPaymentMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; - isSetPaymentMerchantReference = true; // mark as set } /** @@ -367,7 +335,6 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { */ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; - isSetPlatformPaymentType = true; // mark as set return this; } @@ -473,7 +440,6 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; - isSetPlatformPaymentType = true; // mark as set } /** @@ -484,7 +450,6 @@ public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) */ public PlatformPayment pspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; - isSetPspPaymentReference = true; // mark as set return this; } @@ -508,7 +473,6 @@ public String getPspPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; - isSetPspPaymentReference = true; // mark as set } /** @@ -519,7 +483,6 @@ public void setPspPaymentReference(String pspPaymentReference) { */ public PlatformPayment type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -543,27 +506,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -630,46 +572,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetModificationMerchantReference) { - addIfNull( - nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); - } - if (isSetModificationPspReference) { - addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); - } - if (isSetPaymentMerchantReference) { - addIfNull(nulls, JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE, this.paymentMerchantReference); - } - if (isSetPlatformPaymentType) { - addIfNull(nulls, JSON_PROPERTY_PLATFORM_PAYMENT_TYPE, this.platformPaymentType); - } - if (isSetPspPaymentReference) { - addIfNull(nulls, JSON_PROPERTY_PSP_PAYMENT_REFERENCE, this.pspPaymentReference); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of PlatformPayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java b/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java index 5e72f3201..ddc54408d 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +28,9 @@ 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() {} /** @@ -57,7 +43,6 @@ public RelayedAuthorisationData() {} */ public RelayedAuthorisationData metadata(Map metadata) { this.metadata = metadata; - isSetMetadata = true; // mark as set return this; } @@ -93,7 +78,6 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; - isSetMetadata = true; // mark as set } /** @@ -104,7 +88,6 @@ public void setMetadata(Map metadata) { */ public RelayedAuthorisationData reference(String reference) { this.reference = reference; - isSetReference = true; // mark as set return this; } @@ -128,27 +111,6 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; - isSetReference = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -190,33 +152,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetMetadata) { - addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); - } - if (isSetReference) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of RelayedAuthorisationData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Resource.java b/src/main/java/com/adyen/model/transferwebhooks/Resource.java index d557a4955..960a64abd 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Resource.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Resource.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,27 +28,12 @@ public class Resource { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBalancePlatform = false; - public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCreationDate = false; - public static final String JSON_PROPERTY_ID = "id"; private String id; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetId = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public Resource() {} /** @@ -61,7 +44,6 @@ public Resource() {} */ public Resource balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; - isSetBalancePlatform = true; // mark as set return this; } @@ -85,7 +67,6 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; - isSetBalancePlatform = true; // mark as set } /** @@ -98,7 +79,6 @@ public void setBalancePlatform(String balancePlatform) { */ public Resource creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; - isSetCreationDate = true; // mark as set return this; } @@ -126,7 +106,6 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; - isSetCreationDate = true; // mark as set } /** @@ -137,7 +116,6 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Resource id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -161,27 +139,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public Resource includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this Resource object is equal to o. */ @@ -225,36 +182,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetBalancePlatform) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); - } - if (isSetCreationDate) { - addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java index bee51fc2e..b3fe1de89 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,27 +27,12 @@ public class ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetDescription = false; - public static final String JSON_PROPERTY_ID = "id"; private String id; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetId = false; - public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetReference = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public ResourceReference() {} /** @@ -60,7 +43,6 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; - isSetDescription = true; // mark as set return this; } @@ -84,7 +66,6 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; - isSetDescription = true; // mark as set } /** @@ -95,7 +76,6 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -119,7 +99,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set } /** @@ -130,7 +109,6 @@ public void setId(String id) { */ public ResourceReference reference(String reference) { this.reference = reference; - isSetReference = true; // mark as set return this; } @@ -154,27 +132,6 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; - isSetReference = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public ResourceReference includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -218,36 +175,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetDescription) { - addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetReference) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java index 04ff1b0c1..cbebe8b71 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +31,9 @@ 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")); @@ -84,15 +76,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public SELocalAccountIdentification() {} /** @@ -107,7 +90,6 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -139,7 +121,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -154,7 +135,6 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; - isSetClearingNumber = true; // mark as set return this; } @@ -186,7 +166,6 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; - isSetClearingNumber = true; // mark as set } /** @@ -197,7 +176,6 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -221,27 +199,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -285,36 +242,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetClearingNumber) { - addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java index c7ca64c78..1d088d87f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +31,9 @@ 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")); @@ -84,15 +76,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public SGLocalAccountIdentification() {} /** @@ -103,7 +86,6 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -127,7 +109,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -138,7 +119,6 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; - isSetBic = true; // mark as set return this; } @@ -162,7 +142,6 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; - isSetBic = true; // mark as set } /** @@ -173,7 +152,6 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -197,27 +175,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -261,36 +218,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetBic) { - addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java b/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java index 5faa3a1c6..bda7e6d8f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,15 +23,6 @@ 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() {} /** @@ -44,7 +33,6 @@ public ThreeDSecure() {} */ public ThreeDSecure acsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; - isSetAcsTransactionId = true; // mark as set return this; } @@ -68,27 +56,6 @@ 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. */ @@ -128,30 +95,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAcsTransactionId) { - addIfNull(nulls, JSON_PROPERTY_ACS_TRANSACTION_ID, this.acsTransactionId); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of ThreeDSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java index 74f718469..bf42d1869 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,27 +27,12 @@ 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() {} /** @@ -60,7 +43,6 @@ public TransactionEventViolation() {} */ public TransactionEventViolation reason(String reason) { this.reason = reason; - isSetReason = true; // mark as set return this; } @@ -84,7 +66,6 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; - isSetReason = true; // mark as set } /** @@ -95,7 +76,6 @@ public void setReason(String reason) { */ public TransactionEventViolation transactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; - isSetTransactionRule = true; // mark as set return this; } @@ -119,7 +99,6 @@ public TransactionRuleReference getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; - isSetTransactionRule = true; // mark as set } /** @@ -131,7 +110,6 @@ public void setTransactionRule(TransactionRuleReference transactionRule) { public TransactionEventViolation transactionRuleSource( TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; - isSetTransactionRuleSource = true; // mark as set return this; } @@ -155,27 +133,6 @@ 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. */ @@ -222,36 +179,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetReason) { - addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); - } - if (isSetTransactionRule) { - addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); - } - if (isSetTransactionRuleSource) { - addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE_SOURCE, this.transactionRuleSource); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransactionEventViolation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java index 9aef6e6fa..73caf743b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,39 +29,18 @@ 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() {} /** @@ -74,7 +51,6 @@ public TransactionRuleReference() {} */ public TransactionRuleReference description(String description) { this.description = description; - isSetDescription = true; // mark as set return this; } @@ -98,7 +74,6 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; - isSetDescription = true; // mark as set } /** @@ -109,7 +84,6 @@ public void setDescription(String description) { */ public TransactionRuleReference id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -133,7 +107,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set } /** @@ -144,7 +117,6 @@ public void setId(String id) { */ public TransactionRuleReference outcomeType(String outcomeType) { this.outcomeType = outcomeType; - isSetOutcomeType = true; // mark as set return this; } @@ -168,7 +140,6 @@ public String getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(String outcomeType) { this.outcomeType = outcomeType; - isSetOutcomeType = true; // mark as set } /** @@ -179,7 +150,6 @@ public void setOutcomeType(String outcomeType) { */ public TransactionRuleReference reference(String reference) { this.reference = reference; - isSetReference = true; // mark as set return this; } @@ -203,7 +173,6 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; - isSetReference = true; // mark as set } /** @@ -216,7 +185,6 @@ public void setReference(String reference) { */ public TransactionRuleReference score(Integer score) { this.score = score; - isSetScore = true; // mark as set return this; } @@ -244,27 +212,6 @@ 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. */ @@ -312,42 +259,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetDescription) { - addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetOutcomeType) { - addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); - } - if (isSetReference) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); - } - if (isSetScore) { - addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransactionRuleReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java index d820e4a6e..73cab0fca 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,21 +26,9 @@ 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() {} /** @@ -53,7 +39,6 @@ public TransactionRuleSource() {} */ public TransactionRuleSource id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -77,7 +62,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set } /** @@ -94,7 +78,6 @@ public void setId(String id) { */ public TransactionRuleSource type(String type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -130,27 +113,6 @@ 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. */ @@ -192,33 +154,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransactionRuleSource given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java index 821bfc074..8a6be6073 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,34 +30,16 @@ 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() {} /** @@ -70,7 +50,6 @@ public TransactionRulesResult() {} */ public TransactionRulesResult advice(String advice) { this.advice = advice; - isSetAdvice = true; // mark as set return this; } @@ -94,7 +73,6 @@ public String getAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdvice(String advice) { this.advice = advice; - isSetAdvice = true; // mark as set } /** @@ -106,7 +84,6 @@ public void setAdvice(String advice) { */ public TransactionRulesResult allHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; - isSetAllHardBlockRulesPassed = true; // mark as set return this; } @@ -132,7 +109,6 @@ public Boolean getAllHardBlockRulesPassed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; - isSetAllHardBlockRulesPassed = true; // mark as set } /** @@ -143,7 +119,6 @@ public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { */ public TransactionRulesResult score(Integer score) { this.score = score; - isSetScore = true; // mark as set return this; } @@ -167,7 +142,6 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; - isSetScore = true; // mark as set } /** @@ -180,7 +154,6 @@ public void setScore(Integer score) { public TransactionRulesResult triggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; - isSetTriggeredTransactionRules = true; // mark as set return this; } @@ -216,27 +189,6 @@ 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. */ @@ -288,39 +240,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAdvice) { - addIfNull(nulls, JSON_PROPERTY_ADVICE, this.advice); - } - if (isSetAllHardBlockRulesPassed) { - addIfNull(nulls, JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED, this.allHardBlockRulesPassed); - } - if (isSetScore) { - addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); - } - if (isSetTriggeredTransactionRules) { - addIfNull(nulls, JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES, this.triggeredTransactionRules); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransactionRulesResult given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java b/src/main/java/com/adyen/model/transferwebhooks/TransferData.java index 83f39f66b..180fe69ce 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferData.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -62,33 +60,18 @@ 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#responses-200-id) @@ -150,46 +133,25 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCategory = false; - public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferDataCategoryData categoryData; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCategoryData = false; - public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private TransferNotificationCounterParty counterparty; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCounterparty = false; - public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCreatedAt = false; - public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; @Deprecated // deprecated since Transfer webhooks v3: Use createdAt or updatedAt private OffsetDateTime creationDate; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCreationDate = false; - public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetDescription = false; - public static final String JSON_PROPERTY_DIRECT_DEBIT_INFORMATION = "directDebitInformation"; private DirectDebitInformation directDebitInformation; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetDirectDebitInformation = false; - /** The direction of the transfer. Possible values: **incoming**, **outgoing**. */ public enum DirectionEnum { INCOMING(String.valueOf("incoming")), @@ -234,45 +196,24 @@ 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")), @@ -366,33 +307,18 @@ 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. - **refused**: the transfer request is rejected by Adyen for one of the following @@ -575,21 +501,12 @@ 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**. @@ -709,21 +626,9 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - 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() {} /** @@ -734,7 +639,6 @@ public TransferData() {} */ public TransferData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; - isSetAccountHolder = true; // mark as set return this; } @@ -758,7 +662,6 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; - isSetAccountHolder = true; // mark as set } /** @@ -769,7 +672,6 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public TransferData amount(Amount amount) { this.amount = amount; - isSetAmount = true; // mark as set return this; } @@ -793,7 +695,6 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; - isSetAmount = true; // mark as set } /** @@ -804,7 +705,6 @@ public void setAmount(Amount amount) { */ public TransferData balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; - isSetBalanceAccount = true; // mark as set return this; } @@ -828,7 +728,6 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; - isSetBalanceAccount = true; // mark as set } /** @@ -839,7 +738,6 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public TransferData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; - isSetBalancePlatform = true; // mark as set return this; } @@ -863,7 +761,6 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; - isSetBalancePlatform = true; // mark as set } /** @@ -874,7 +771,6 @@ public void setBalancePlatform(String balancePlatform) { */ public TransferData balances(List balances) { this.balances = balances; - isSetBalances = true; // mark as set return this; } @@ -906,7 +802,6 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; - isSetBalances = true; // mark as set } /** @@ -932,7 +827,6 @@ public void setBalances(List balances) { */ public TransferData category(CategoryEnum category) { this.category = category; - isSetCategory = true; // mark as set return this; } @@ -986,7 +880,6 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; - isSetCategory = true; // mark as set } /** @@ -997,7 +890,6 @@ public void setCategory(CategoryEnum category) { */ public TransferData categoryData(TransferDataCategoryData categoryData) { this.categoryData = categoryData; - isSetCategoryData = true; // mark as set return this; } @@ -1021,7 +913,6 @@ public TransferDataCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferDataCategoryData categoryData) { this.categoryData = categoryData; - isSetCategoryData = true; // mark as set } /** @@ -1032,7 +923,6 @@ public void setCategoryData(TransferDataCategoryData categoryData) { */ public TransferData counterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; - isSetCounterparty = true; // mark as set return this; } @@ -1056,7 +946,6 @@ public TransferNotificationCounterParty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; - isSetCounterparty = true; // mark as set } /** @@ -1069,7 +958,6 @@ public void setCounterparty(TransferNotificationCounterParty counterparty) { */ public TransferData createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; - isSetCreatedAt = true; // mark as set return this; } @@ -1097,7 +985,6 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; - isSetCreatedAt = true; // mark as set } /** @@ -1112,7 +999,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { @Deprecated // deprecated since Transfer webhooks v3: Use createdAt or updatedAt public TransferData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; - isSetCreationDate = true; // mark as set return this; } @@ -1144,7 +1030,6 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; - isSetCreationDate = true; // mark as set } /** @@ -1163,7 +1048,6 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public TransferData description(String description) { this.description = description; - isSetDescription = true; // mark as set return this; } @@ -1203,7 +1087,6 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; - isSetDescription = true; // mark as set } /** @@ -1214,7 +1097,6 @@ public void setDescription(String description) { */ public TransferData directDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; - isSetDirectDebitInformation = true; // mark as set return this; } @@ -1238,7 +1120,6 @@ public DirectDebitInformation getDirectDebitInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; - isSetDirectDebitInformation = true; // mark as set } /** @@ -1249,7 +1130,6 @@ public void setDirectDebitInformation(DirectDebitInformation directDebitInformat */ public TransferData direction(DirectionEnum direction) { this.direction = direction; - isSetDirection = true; // mark as set return this; } @@ -1273,7 +1153,6 @@ public DirectionEnum getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(DirectionEnum direction) { this.direction = direction; - isSetDirection = true; // mark as set } /** @@ -1286,7 +1165,6 @@ public void setDirection(DirectionEnum direction) { */ public TransferData eventId(String eventId) { this.eventId = eventId; - isSetEventId = true; // mark as set return this; } @@ -1314,7 +1192,6 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; - isSetEventId = true; // mark as set } /** @@ -1325,7 +1202,6 @@ public void setEventId(String eventId) { */ public TransferData events(List events) { this.events = events; - isSetEvents = true; // mark as set return this; } @@ -1357,7 +1233,6 @@ public List getEvents() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEvents(List events) { this.events = events; - isSetEvents = true; // mark as set } /** @@ -1368,7 +1243,6 @@ public void setEvents(List events) { */ public TransferData executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; - isSetExecutionDate = true; // mark as set return this; } @@ -1392,7 +1266,6 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; - isSetExecutionDate = true; // mark as set } /** @@ -1403,7 +1276,6 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public TransferData externalReason(ExternalReason externalReason) { this.externalReason = externalReason; - isSetExternalReason = true; // mark as set return this; } @@ -1427,7 +1299,6 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; - isSetExternalReason = true; // mark as set } /** @@ -1438,7 +1309,6 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferData id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -1462,7 +1332,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set } /** @@ -1473,7 +1342,6 @@ public void setId(String id) { */ public TransferData paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; - isSetPaymentInstrument = true; // mark as set return this; } @@ -1497,7 +1365,6 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; - isSetPaymentInstrument = true; // mark as set } /** @@ -1508,7 +1375,6 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public TransferData reason(ReasonEnum reason) { this.reason = reason; - isSetReason = true; // mark as set return this; } @@ -1532,7 +1398,6 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; - isSetReason = true; // mark as set } /** @@ -1545,7 +1410,6 @@ public void setReason(ReasonEnum reason) { */ public TransferData reference(String reference) { this.reference = reference; - isSetReference = true; // mark as set return this; } @@ -1573,7 +1437,6 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; - isSetReference = true; // mark as set } /** @@ -1592,7 +1455,6 @@ public void setReference(String reference) { */ public TransferData referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; - isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -1632,7 +1494,6 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; - isSetReferenceForBeneficiary = true; // mark as set } /** @@ -1643,7 +1504,6 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public TransferData review(TransferReview review) { this.review = review; - isSetReview = true; // mark as set return this; } @@ -1667,7 +1527,6 @@ public TransferReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferReview review) { this.review = review; - isSetReview = true; // mark as set } /** @@ -1682,7 +1541,6 @@ public void setReview(TransferReview review) { */ public TransferData sequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; - isSetSequenceNumber = true; // mark as set return this; } @@ -1714,7 +1572,6 @@ public Integer getSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; - isSetSequenceNumber = true; // mark as set } /** @@ -1738,7 +1595,6 @@ public void setSequenceNumber(Integer sequenceNumber) { */ public TransferData status(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set return this; } @@ -1788,7 +1644,6 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set } /** @@ -1799,7 +1654,6 @@ public void setStatus(StatusEnum status) { */ public TransferData tracking(TransferDataTracking tracking) { this.tracking = tracking; - isSetTracking = true; // mark as set return this; } @@ -1823,7 +1677,6 @@ public TransferDataTracking getTracking() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTracking(TransferDataTracking tracking) { this.tracking = tracking; - isSetTracking = true; // mark as set } /** @@ -1834,7 +1687,6 @@ public void setTracking(TransferDataTracking tracking) { */ public TransferData transactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; - isSetTransactionRulesResult = true; // mark as set return this; } @@ -1858,7 +1710,6 @@ public TransactionRulesResult getTransactionRulesResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; - isSetTransactionRulesResult = true; // mark as set } /** @@ -1871,7 +1722,6 @@ public void setTransactionRulesResult(TransactionRulesResult transactionRulesRes */ public TransferData type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -1899,7 +1749,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set } /** @@ -1912,7 +1761,6 @@ public void setType(TypeEnum type) { */ public TransferData updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; - isSetUpdatedAt = true; // mark as set return this; } @@ -1940,27 +1788,6 @@ 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. */ @@ -2091,114 +1918,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountHolder) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); - } - if (isSetAmount) { - addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); - } - if (isSetBalanceAccount) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); - } - if (isSetBalancePlatform) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); - } - if (isSetBalances) { - addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); - } - if (isSetCategory) { - addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); - } - if (isSetCategoryData) { - addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); - } - if (isSetCounterparty) { - addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); - } - if (isSetCreatedAt) { - addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); - } - if (isSetCreationDate) { - addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); - } - if (isSetDescription) { - addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); - } - if (isSetDirectDebitInformation) { - addIfNull(nulls, JSON_PROPERTY_DIRECT_DEBIT_INFORMATION, this.directDebitInformation); - } - if (isSetDirection) { - addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); - } - if (isSetEventId) { - addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); - } - if (isSetEvents) { - addIfNull(nulls, JSON_PROPERTY_EVENTS, this.events); - } - if (isSetExecutionDate) { - addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); - } - if (isSetExternalReason) { - addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetPaymentInstrument) { - addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); - } - if (isSetReason) { - addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); - } - if (isSetReference) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); - } - if (isSetReferenceForBeneficiary) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); - } - if (isSetReview) { - addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); - } - if (isSetSequenceNumber) { - addIfNull(nulls, JSON_PROPERTY_SEQUENCE_NUMBER, this.sequenceNumber); - } - if (isSetStatus) { - addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); - } - if (isSetTracking) { - addIfNull(nulls, JSON_PROPERTY_TRACKING, this.tracking); - } - if (isSetTransactionRulesResult) { - addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULES_RESULT, this.transactionRulesResult); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - if (isSetUpdatedAt) { - addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransferData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java index 0cf3aab77..f14b86ca7 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -51,69 +49,36 @@ 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")), @@ -207,9 +172,6 @@ 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")), @@ -384,21 +346,12 @@ 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")), @@ -443,27 +396,12 @@ public static TypeEnum fromValue(String 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() {} /** @@ -474,7 +412,6 @@ public TransferEvent() {} */ public TransferEvent amount(Amount amount) { this.amount = amount; - isSetAmount = true; // mark as set return this; } @@ -498,7 +435,6 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; - isSetAmount = true; // mark as set } /** @@ -511,7 +447,6 @@ public void setAmount(Amount amount) { */ public TransferEvent amountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; - isSetAmountAdjustments = true; // mark as set return this; } @@ -547,7 +482,6 @@ public List getAmountAdjustments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; - isSetAmountAdjustments = true; // mark as set } /** @@ -558,7 +492,6 @@ public void setAmountAdjustments(List amountAdjustments) { */ public TransferEvent arn(String arn) { this.arn = arn; - isSetArn = true; // mark as set return this; } @@ -583,7 +516,6 @@ public String getArn() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArn(String arn) { this.arn = arn; - isSetArn = true; // mark as set } /** @@ -594,7 +526,6 @@ public void setArn(String arn) { */ public TransferEvent bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; - isSetBookingDate = true; // mark as set return this; } @@ -618,7 +549,6 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; - isSetBookingDate = true; // mark as set } /** @@ -630,7 +560,6 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public TransferEvent estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; - isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -656,7 +585,6 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; - isSetEstimatedArrivalTime = true; // mark as set } /** @@ -667,7 +595,6 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public TransferEvent eventsData(List eventsData) { this.eventsData = eventsData; - isSetEventsData = true; // mark as set return this; } @@ -699,7 +626,6 @@ public List getEventsData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventsData(List eventsData) { this.eventsData = eventsData; - isSetEventsData = true; // mark as set } /** @@ -710,7 +636,6 @@ public void setEventsData(List eventsData) { */ public TransferEvent externalReason(ExternalReason externalReason) { this.externalReason = externalReason; - isSetExternalReason = true; // mark as set return this; } @@ -734,7 +659,6 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; - isSetExternalReason = true; // mark as set } /** @@ -745,7 +669,6 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferEvent id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -769,7 +692,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set } /** @@ -780,7 +702,6 @@ public void setId(String id) { */ public TransferEvent modification(Modification modification) { this.modification = modification; - isSetModification = true; // mark as set return this; } @@ -804,7 +725,6 @@ public Modification getModification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModification(Modification modification) { this.modification = modification; - isSetModification = true; // mark as set } /** @@ -815,7 +735,6 @@ public void setModification(Modification modification) { */ public TransferEvent mutations(List mutations) { this.mutations = mutations; - isSetMutations = true; // mark as set return this; } @@ -847,7 +766,6 @@ public List getMutations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMutations(List mutations) { this.mutations = mutations; - isSetMutations = true; // mark as set } /** @@ -858,7 +776,6 @@ public void setMutations(List mutations) { */ public TransferEvent originalAmount(Amount originalAmount) { this.originalAmount = originalAmount; - isSetOriginalAmount = true; // mark as set return this; } @@ -882,7 +799,6 @@ public Amount getOriginalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; - isSetOriginalAmount = true; // mark as set } /** @@ -893,7 +809,6 @@ public void setOriginalAmount(Amount originalAmount) { */ public TransferEvent reason(ReasonEnum reason) { this.reason = reason; - isSetReason = true; // mark as set return this; } @@ -917,7 +832,6 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; - isSetReason = true; // mark as set } /** @@ -928,7 +842,6 @@ public void setReason(ReasonEnum reason) { */ public TransferEvent status(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set return this; } @@ -952,7 +865,6 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; - isSetStatus = true; // mark as set } /** @@ -963,7 +875,6 @@ public void setStatus(StatusEnum status) { */ public TransferEvent trackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; - isSetTrackingData = true; // mark as set return this; } @@ -987,7 +898,6 @@ public TransferEventTrackingData getTrackingData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; - isSetTrackingData = true; // mark as set } /** @@ -1000,7 +910,6 @@ public void setTrackingData(TransferEventTrackingData trackingData) { */ public TransferEvent transactionId(String transactionId) { this.transactionId = transactionId; - isSetTransactionId = true; // mark as set return this; } @@ -1028,7 +937,6 @@ public String getTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionId(String transactionId) { this.transactionId = transactionId; - isSetTransactionId = true; // mark as set } /** @@ -1039,7 +947,6 @@ public void setTransactionId(String transactionId) { */ public TransferEvent type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -1063,7 +970,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set } /** @@ -1074,7 +980,6 @@ public void setType(TypeEnum type) { */ public TransferEvent updateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; - isSetUpdateDate = true; // mark as set return this; } @@ -1098,7 +1003,6 @@ public OffsetDateTime getUpdateDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; - isSetUpdateDate = true; // mark as set } /** @@ -1111,7 +1015,6 @@ public void setUpdateDate(OffsetDateTime updateDate) { */ public TransferEvent valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; - isSetValueDate = true; // mark as set return this; } @@ -1139,27 +1042,6 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; - isSetValueDate = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -1253,81 +1135,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAmount) { - addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); - } - if (isSetAmountAdjustments) { - addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENTS, this.amountAdjustments); - } - if (isSetArn) { - addIfNull(nulls, JSON_PROPERTY_ARN, this.arn); - } - if (isSetBookingDate) { - addIfNull(nulls, JSON_PROPERTY_BOOKING_DATE, this.bookingDate); - } - if (isSetEstimatedArrivalTime) { - addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); - } - if (isSetEventsData) { - addIfNull(nulls, JSON_PROPERTY_EVENTS_DATA, this.eventsData); - } - if (isSetExternalReason) { - addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetModification) { - addIfNull(nulls, JSON_PROPERTY_MODIFICATION, this.modification); - } - if (isSetMutations) { - addIfNull(nulls, JSON_PROPERTY_MUTATIONS, this.mutations); - } - if (isSetOriginalAmount) { - addIfNull(nulls, JSON_PROPERTY_ORIGINAL_AMOUNT, this.originalAmount); - } - if (isSetReason) { - addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); - } - if (isSetStatus) { - addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); - } - if (isSetTrackingData) { - addIfNull(nulls, JSON_PROPERTY_TRACKING_DATA, this.trackingData); - } - if (isSetTransactionId) { - addIfNull(nulls, JSON_PROPERTY_TRANSACTION_ID, this.transactionId); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - if (isSetUpdateDate) { - addIfNull(nulls, JSON_PROPERTY_UPDATE_DATE, this.updateDate); - } - if (isSetValueDate) { - addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransferEvent given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java index 8a72a8e28..cb9c7a255 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,39 +29,18 @@ 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() {} /** @@ -77,7 +54,6 @@ public TransferNotificationCounterParty() {} */ public TransferNotificationCounterParty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; - isSetBalanceAccountId = true; // mark as set return this; } @@ -105,7 +81,6 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; - isSetBalanceAccountId = true; // mark as set } /** @@ -117,7 +92,6 @@ public void setBalanceAccountId(String balanceAccountId) { */ public TransferNotificationCounterParty bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; - isSetBankAccount = true; // mark as set return this; } @@ -141,7 +115,6 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; - isSetBankAccount = true; // mark as set } /** @@ -153,7 +126,6 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public TransferNotificationCounterParty card(Card card) { this.card = card; - isSetCard = true; // mark as set return this; } @@ -177,7 +149,6 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; - isSetCard = true; // mark as set } /** @@ -189,7 +160,6 @@ public void setCard(Card card) { */ public TransferNotificationCounterParty merchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; - isSetMerchant = true; // mark as set return this; } @@ -213,7 +183,6 @@ public TransferNotificationMerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; - isSetMerchant = true; // mark as set } /** @@ -227,7 +196,6 @@ public void setMerchant(TransferNotificationMerchantData merchant) { */ public TransferNotificationCounterParty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; - isSetTransferInstrumentId = true; // mark as set return this; } @@ -255,27 +223,6 @@ 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. */ @@ -327,42 +274,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetBalanceAccountId) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); - } - if (isSetBankAccount) { - addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); - } - if (isSetCard) { - addIfNull(nulls, JSON_PROPERTY_CARD, this.card); - } - if (isSetMerchant) { - addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); - } - if (isSetTransferInstrumentId) { - addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransferNotificationCounterParty given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java index 44acc9612..1595c6a5b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,51 +31,24 @@ 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() {} /** @@ -89,7 +60,6 @@ public TransferNotificationMerchantData() {} */ public TransferNotificationMerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; - isSetAcquirerId = true; // mark as set return this; } @@ -113,7 +83,6 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; - isSetAcquirerId = true; // mark as set } /** @@ -125,7 +94,6 @@ public void setAcquirerId(String acquirerId) { */ public TransferNotificationMerchantData city(String city) { this.city = city; - isSetCity = true; // mark as set return this; } @@ -149,7 +117,6 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; - isSetCity = true; // mark as set } /** @@ -161,7 +128,6 @@ public void setCity(String city) { */ public TransferNotificationMerchantData country(String country) { this.country = country; - isSetCountry = true; // mark as set return this; } @@ -185,7 +151,6 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; - isSetCountry = true; // mark as set } /** @@ -197,7 +162,6 @@ public void setCountry(String country) { */ public TransferNotificationMerchantData mcc(String mcc) { this.mcc = mcc; - isSetMcc = true; // mark as set return this; } @@ -221,7 +185,6 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; - isSetMcc = true; // mark as set } /** @@ -233,7 +196,6 @@ public void setMcc(String mcc) { */ public TransferNotificationMerchantData merchantId(String merchantId) { this.merchantId = merchantId; - isSetMerchantId = true; // mark as set return this; } @@ -257,7 +219,6 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; - isSetMerchantId = true; // mark as set } /** @@ -269,7 +230,6 @@ public void setMerchantId(String merchantId) { */ public TransferNotificationMerchantData name(String name) { this.name = name; - isSetName = true; // mark as set return this; } @@ -293,7 +253,6 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; - isSetName = true; // mark as set } /** @@ -305,7 +264,6 @@ public void setName(String name) { */ public TransferNotificationMerchantData postalCode(String postalCode) { this.postalCode = postalCode; - isSetPostalCode = true; // mark as set return this; } @@ -329,27 +287,6 @@ 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. */ @@ -402,48 +339,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAcquirerId) { - addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); - } - if (isSetCity) { - addIfNull(nulls, JSON_PROPERTY_CITY, this.city); - } - if (isSetCountry) { - addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); - } - if (isSetMcc) { - addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); - } - if (isSetMerchantId) { - addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); - } - if (isSetName) { - addIfNull(nulls, JSON_PROPERTY_NAME, this.name); - } - if (isSetPostalCode) { - addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransferNotificationMerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java index 780f01caa..3807a8fb1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +33,12 @@ public class TransferNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private TransferData data; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetData = false; - public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetEnvironment = false; - public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetTimestamp = false; - /** The type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_TRANSFER_CREATED(String.valueOf("balancePlatform.transfer.created")), @@ -94,15 +83,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public TransferNotificationRequest() {} /** @@ -113,7 +93,6 @@ public TransferNotificationRequest() {} */ public TransferNotificationRequest data(TransferData data) { this.data = data; - isSetData = true; // mark as set return this; } @@ -137,7 +116,6 @@ public TransferData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(TransferData data) { this.data = data; - isSetData = true; // mark as set } /** @@ -149,7 +127,6 @@ public void setData(TransferData data) { */ public TransferNotificationRequest environment(String environment) { this.environment = environment; - isSetEnvironment = true; // mark as set return this; } @@ -175,7 +152,6 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; - isSetEnvironment = true; // mark as set } /** @@ -186,7 +162,6 @@ public void setEnvironment(String environment) { */ public TransferNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; - isSetTimestamp = true; // mark as set return this; } @@ -210,7 +185,6 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; - isSetTimestamp = true; // mark as set } /** @@ -221,7 +195,6 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public TransferNotificationRequest type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -245,27 +218,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public TransferNotificationRequest includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationRequest object is equal to o. */ @@ -311,39 +263,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetData) { - addIfNull(nulls, JSON_PROPERTY_DATA, this.data); - } - if (isSetEnvironment) { - addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); - } - if (isSetTimestamp) { - addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransferNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java index 4a45b436a..efaaecffd 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java @@ -11,8 +11,6 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,21 +26,9 @@ 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() {} /** @@ -54,7 +40,6 @@ public TransferNotificationValidationFact() {} */ public TransferNotificationValidationFact result(String result) { this.result = result; - isSetResult = true; // mark as set return this; } @@ -78,7 +63,6 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; - isSetResult = true; // mark as set } /** @@ -90,7 +74,6 @@ public void setResult(String result) { */ public TransferNotificationValidationFact type(String type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -114,27 +97,6 @@ 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. */ @@ -177,33 +139,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetResult) { - addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransferNotificationValidationFact given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java b/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java index 36129abb4..6d8f4bd11 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +31,6 @@ 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**. @@ -85,15 +80,6 @@ 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() {} /** @@ -108,7 +94,6 @@ public TransferReview() {} */ public TransferReview numberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; - isSetNumberOfApprovalsRequired = true; // mark as set return this; } @@ -140,7 +125,6 @@ public Integer getNumberOfApprovalsRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; - isSetNumberOfApprovalsRequired = true; // mark as set } /** @@ -153,7 +137,6 @@ public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { */ public TransferReview scaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; - isSetScaOnApproval = true; // mark as set return this; } @@ -181,27 +164,6 @@ 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. */ @@ -245,33 +207,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetNumberOfApprovalsRequired) { - addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_APPROVALS_REQUIRED, this.numberOfApprovalsRequired); - } - if (isSetScaOnApproval) { - addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of TransferReview given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java index 71c5fe8d4..726a08c59 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +31,9 @@ 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")); @@ -84,15 +76,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public UKLocalAccountIdentification() {} /** @@ -103,7 +86,6 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -127,7 +109,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -140,7 +121,6 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; - isSetSortCode = true; // mark as set return this; } @@ -168,7 +148,6 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; - isSetSortCode = true; // mark as set } /** @@ -179,7 +158,6 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -203,27 +181,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -267,36 +224,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountNumber) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); - } - if (isSetSortCode) { - addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java index 42b852437..d11a9c0a2 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java @@ -11,9 +11,7 @@ package com.adyen.model.transferwebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,9 +32,6 @@ 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**. */ @@ -83,15 +78,9 @@ 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")); @@ -134,15 +123,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public USLocalAccountIdentification() {} /** @@ -153,7 +133,6 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set return this; } @@ -177,7 +156,6 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; - isSetAccountNumber = true; // mark as set } /** @@ -189,7 +167,6 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; - isSetAccountType = true; // mark as set return this; } @@ -215,7 +192,6 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; - isSetAccountType = true; // mark as set } /** @@ -229,7 +205,6 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; - isSetRoutingNumber = true; // mark as set return this; } @@ -259,7 +234,6 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; - isSetRoutingNumber = true; // mark as set } /** @@ -270,7 +244,6 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -294,27 +267,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public 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. */ @@ -360,39 +312,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (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 *