From 54ea57ea4514df27285b056d9dc389c4fd022fd9 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Mon, 9 Mar 2026 13:31:59 +0000 Subject: [PATCH] [transferwebhooks] Automated update from Adyen/adyen-openapi@37c03ec --- .../AULocalAccountIdentification.java | 82 ++++- .../AbstractOpenApiSchema.java | 2 +- .../AdditionalBankIdentification.java | 73 +++- .../{transferwebhooks => java}/Address.java | 121 +++++- .../{transferwebhooks => java}/Airline.java | 73 +++- .../{transferwebhooks => java}/Amount.java | 73 +++- .../AmountAdjustment.java | 89 ++++- .../BRLocalAccountIdentification.java | 110 +++++- .../BalanceMutation.java | 99 ++++- .../BalancePlatformNotificationResponse.java | 66 +++- .../BankAccountV3.java | 89 ++++- .../BankAccountV3AccountIdentification.java | 2 +- .../BankCategoryData.java | 73 +++- .../CALocalAccountIdentification.java | 111 +++++- .../CZLocalAccountIdentification.java | 83 ++++- .../{transferwebhooks => java}/Card.java | 73 +++- .../CardIdentification.java | 132 ++++++- .../ConfirmationTrackingData.java | 73 +++- .../CounterpartyV3.java | 110 +++++- .../DKLocalAccountIdentification.java | 83 ++++- .../DirectDebitInformation.java | 99 ++++- .../EstimationTrackingData.java | 74 +++- .../ExecutionDate.java | 73 +++- .../ExternalReason.java | 82 ++++- .../HKLocalAccountIdentification.java | 83 ++++- .../HULocalAccountIdentification.java | 73 +++- .../IbanAccountIdentification.java | 73 +++- .../InterchangeData.java | 89 ++++- .../InternalCategoryData.java | 92 ++++- .../InternalReviewTrackingData.java | 82 ++++- .../IssuedCard.java | 147 +++++++- .../IssuingTransactionData.java | 73 +++- .../model/{transferwebhooks => java}/Leg.java | 115 +++++- .../{transferwebhooks => java}/Lodging.java | 73 +++- .../MerchantData.java | 110 +++++- .../MerchantPurchaseData.java | 82 ++++- .../Modification.java | 110 +++++- .../NOLocalAccountIdentification.java | 73 +++- .../NZLocalAccountIdentification.java | 73 +++- .../NameLocation.java | 121 +++++- .../NumberAndBicAccountIdentification.java | 103 +++++- .../PLLocalAccountIdentification.java | 73 +++- .../PartyIdentification.java | 153 +++++++- .../PaymentInstrument.java | 99 ++++- .../PlatformPayment.java | 120 +++++- .../RelayedAuthorisationData.java | 73 +++- .../{transferwebhooks => java}/Resource.java | 83 ++++- .../ResourceReference.java | 82 ++++- .../SELocalAccountIdentification.java | 84 ++++- .../SGLocalAccountIdentification.java | 82 ++++- .../ThreeDSecure.java | 64 +++- .../TransactionEventViolation.java | 89 ++++- .../TransactionRuleReference.java | 110 +++++- .../TransactionRuleSource.java | 73 +++- .../TransactionRulesResult.java | 102 ++++- .../TransferData.java | 348 +++++++++++++++++- .../TransferDataCategoryData.java | 2 +- .../TransferDataTracking.java | 2 +- .../TransferEvent.java | 235 +++++++++++- .../TransferEventEventsDataInner.java | 2 +- .../TransferEventTrackingData.java | 2 +- .../TransferNotificationCounterParty.java | 113 +++++- .../TransferNotificationMerchantData.java | 132 ++++++- .../TransferNotificationRequest.java | 92 ++++- .../TransferNotificationValidationFact.java | 73 +++- .../TransferReview.java | 78 +++- .../UKLocalAccountIdentification.java | 83 ++++- .../USLocalAccountIdentification.java | 99 ++++- .../adyen/model/transferwebhooks/JSON.java | 2 +- .../TransferWebhooksHandler.java | 77 ---- 70 files changed, 5874 insertions(+), 270 deletions(-) rename src/main/java/com/adyen/model/{transferwebhooks => java}/AULocalAccountIdentification.java (73%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/AbstractOpenApiSchema.java (98%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/AdditionalBankIdentification.java (82%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/Address.java (78%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/Airline.java (66%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/Amount.java (69%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/AmountAdjustment.java (73%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/BRLocalAccountIdentification.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/BalanceMutation.java (73%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/BalancePlatformNotificationResponse.java (66%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/BankAccountV3.java (67%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/BankAccountV3AccountIdentification.java (99%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/BankCategoryData.java (84%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/CALocalAccountIdentification.java (75%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/CZLocalAccountIdentification.java (77%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/Card.java (63%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/CardIdentification.java (76%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/ConfirmationTrackingData.java (78%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/CounterpartyV3.java (71%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/DKLocalAccountIdentification.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/DirectDebitInformation.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/EstimationTrackingData.java (74%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/ExecutionDate.java (75%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/ExternalReason.java (66%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/HKLocalAccountIdentification.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/HULocalAccountIdentification.java (70%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/IbanAccountIdentification.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/InterchangeData.java (74%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/InternalCategoryData.java (70%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/InternalReviewTrackingData.java (82%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/IssuedCard.java (81%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/IssuingTransactionData.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/Leg.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/Lodging.java (64%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/MerchantData.java (68%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/MerchantPurchaseData.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/Modification.java (78%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/NOLocalAccountIdentification.java (70%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/NZLocalAccountIdentification.java (73%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/NameLocation.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/NumberAndBicAccountIdentification.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/PLLocalAccountIdentification.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/PartyIdentification.java (80%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/PaymentInstrument.java (68%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/PlatformPayment.java (85%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/RelayedAuthorisationData.java (70%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/Resource.java (68%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/ResourceReference.java (67%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/SELocalAccountIdentification.java (74%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/SGLocalAccountIdentification.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/ThreeDSecure.java (63%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransactionEventViolation.java (67%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransactionRuleReference.java (70%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransactionRuleSource.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransactionRulesResult.java (71%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferData.java (84%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferDataCategoryData.java (99%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferDataTracking.java (99%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferEvent.java (82%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferEventEventsDataInner.java (99%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferEventTrackingData.java (99%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferNotificationCounterParty.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferNotificationMerchantData.java (71%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferNotificationRequest.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferNotificationValidationFact.java (67%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/TransferReview.java (74%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/UKLocalAccountIdentification.java (72%) rename src/main/java/com/adyen/model/{transferwebhooks => java}/USLocalAccountIdentification.java (75%) delete mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransferWebhooksHandler.java diff --git a/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/java/AULocalAccountIdentification.java similarity index 73% rename from src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/AULocalAccountIdentification.java index 840af2718..b7784a1cf 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/AULocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class AULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; private String bsbCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + /** **auLocal** */ public enum TypeEnum { AULOCAL(String.valueOf("auLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AULocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AULocalAccountIdentification object is equal to o. */ @@ -194,13 +237,16 @@ public boolean equals(Object o) { } AULocalAccountIdentification auLocalAccountIdentification = (AULocalAccountIdentification) o; return Objects.equals(this.accountNumber, auLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, auLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bsbCode, auLocalAccountIdentification.bsbCode) - && Objects.equals(this.type, auLocalAccountIdentification.type); + && Objects.equals(this.isSetBsbCode, auLocalAccountIdentification.isSetBsbCode) + && Objects.equals(this.type, auLocalAccountIdentification.type) + && Objects.equals(this.isSetType, auLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bsbCode, type); + return Objects.hash(accountNumber, isSetAccountNumber, bsbCode, isSetBsbCode, type, isSetType); } @Override @@ -224,6 +270,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/java/AbstractOpenApiSchema.java similarity index 98% rename from src/main/java/com/adyen/model/transferwebhooks/AbstractOpenApiSchema.java rename to src/main/java/com/adyen/model/java/AbstractOpenApiSchema.java index 5fdd90656..d17c8f65c 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/java/AbstractOpenApiSchema.java @@ -9,7 +9,7 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; import com.fasterxml.jackson.annotation.JsonValue; import jakarta.ws.rs.core.GenericType; diff --git a/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/java/AdditionalBankIdentification.java similarity index 82% rename from src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java rename to src/main/java/com/adyen/model/java/AdditionalBankIdentification.java index 2cd17d0bb..e66aa8337 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/java/AdditionalBankIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class AdditionalBankIdentification { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + /** * The type of additional bank identification, depending on the country. Possible values: * * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) @@ -89,6 +94,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalBankIdentification() {} /** @@ -99,6 +113,7 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -122,6 +137,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -150,6 +166,7 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -209,6 +226,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalBankIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalBankIdentification object is equal to o. */ @@ -222,12 +260,14 @@ public boolean equals(Object o) { } AdditionalBankIdentification additionalBankIdentification = (AdditionalBankIdentification) o; return Objects.equals(this.code, additionalBankIdentification.code) - && Objects.equals(this.type, additionalBankIdentification.type); + && Objects.equals(this.isSetCode, additionalBankIdentification.isSetCode) + && Objects.equals(this.type, additionalBankIdentification.type) + && Objects.equals(this.isSetType, additionalBankIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(code, type); + return Objects.hash(code, isSetCode, type, isSetType); } @Override @@ -250,6 +290,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Address.java b/src/main/java/com/adyen/model/java/Address.java similarity index 78% rename from src/main/java/com/adyen/model/transferwebhooks/Address.java rename to src/main/java/com/adyen/model/java/Address.java index d7ed7cc91..e0d155cbe 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Address.java +++ b/src/main/java/com/adyen/model/java/Address.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Address { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Address() {} /** @@ -57,6 +83,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -95,6 +123,7 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -120,6 +149,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setCountry(String country) { */ public Address line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -175,6 +207,7 @@ public void setLine1(String line1) { */ public Address line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -204,6 +237,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -218,6 +252,7 @@ public void setLine2(String line2) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -249,6 +284,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -261,6 +297,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -288,6 +325,27 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Address includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Address object is equal to o. */ @@ -301,16 +359,34 @@ public boolean equals(Object o) { } Address address = (Address) o; return Objects.equals(this.city, address.city) + && Objects.equals(this.isSetCity, address.isSetCity) && Objects.equals(this.country, address.country) + && Objects.equals(this.isSetCountry, address.isSetCountry) && Objects.equals(this.line1, address.line1) + && Objects.equals(this.isSetLine1, address.isSetLine1) && Objects.equals(this.line2, address.line2) + && Objects.equals(this.isSetLine2, address.isSetLine2) && Objects.equals(this.postalCode, address.postalCode) - && Objects.equals(this.stateOrProvince, address.stateOrProvince); + && Objects.equals(this.isSetPostalCode, address.isSetPostalCode) + && Objects.equals(this.stateOrProvince, address.stateOrProvince) + && Objects.equals(this.isSetStateOrProvince, address.isSetStateOrProvince); } @Override public int hashCode() { - return Objects.hash(city, country, line1, line2, postalCode, stateOrProvince); + return Objects.hash( + city, + isSetCity, + country, + isSetCountry, + line1, + isSetLine1, + line2, + isSetLine2, + postalCode, + isSetPostalCode, + stateOrProvince, + isSetStateOrProvince); } @Override @@ -337,6 +413,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Address given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Airline.java b/src/main/java/com/adyen/model/java/Airline.java similarity index 66% rename from src/main/java/com/adyen/model/transferwebhooks/Airline.java rename to src/main/java/com/adyen/model/java/Airline.java index bfe6ad80c..0b06a7ab5 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Airline.java +++ b/src/main/java/com/adyen/model/java/Airline.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,9 +27,21 @@ public class Airline { public static final String JSON_PROPERTY_LEGS = "legs"; private List legs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegs = false; + public static final String JSON_PROPERTY_TICKET_NUMBER = "ticketNumber"; private String ticketNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTicketNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Airline() {} /** @@ -38,6 +52,7 @@ public Airline() {} */ public Airline legs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set return this; } @@ -69,6 +84,7 @@ public List getLegs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setLegs(List legs) { */ public Airline ticketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set return this; } @@ -102,6 +119,27 @@ public String getTicketNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTicketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Airline includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Airline object is equal to o. */ @@ -115,12 +153,14 @@ public boolean equals(Object o) { } Airline airline = (Airline) o; return Objects.equals(this.legs, airline.legs) - && Objects.equals(this.ticketNumber, airline.ticketNumber); + && Objects.equals(this.isSetLegs, airline.isSetLegs) + && Objects.equals(this.ticketNumber, airline.ticketNumber) + && Objects.equals(this.isSetTicketNumber, airline.isSetTicketNumber); } @Override public int hashCode() { - return Objects.hash(legs, ticketNumber); + return Objects.hash(legs, isSetLegs, ticketNumber, isSetTicketNumber); } @Override @@ -143,6 +183,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLegs) { + addIfNull(nulls, JSON_PROPERTY_LEGS, this.legs); + } + if (isSetTicketNumber) { + addIfNull(nulls, JSON_PROPERTY_TICKET_NUMBER, this.ticketNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Airline given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Amount.java b/src/main/java/com/adyen/model/java/Amount.java similarity index 69% rename from src/main/java/com/adyen/model/transferwebhooks/Amount.java rename to src/main/java/com/adyen/model/java/Amount.java index 0cd70f18a..0ee1e5055 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/java/Amount.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Amount { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Long value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Amount() {} /** @@ -40,6 +54,7 @@ public Amount() {} */ public Amount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -71,6 +86,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -83,6 +99,7 @@ public void setCurrency(String currency) { */ public Amount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -110,6 +127,27 @@ public Long getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public 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. */ @@ -123,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 @@ -151,6 +191,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Amount given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java b/src/main/java/com/adyen/model/java/AmountAdjustment.java similarity index 73% rename from src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java rename to src/main/java/com/adyen/model/java/AmountAdjustment.java index 00fff8f3a..64eabf513 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java +++ b/src/main/java/com/adyen/model/java/AmountAdjustment.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class AmountAdjustment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The type of markup that is applied to an authorised payment. Possible values: **exchange**, * **forexMarkup**, **authHoldReserve**, **atmMarkup**. @@ -82,9 +87,21 @@ public static AmountAdjustmentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE = "amountAdjustmentType"; private AmountAdjustmentTypeEnum amountAdjustmentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustmentType = false; + public static final String JSON_PROPERTY_BASEPOINTS = "basepoints"; private Integer basepoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasepoints = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AmountAdjustment() {} /** @@ -95,6 +112,7 @@ public AmountAdjustment() {} */ public AmountAdjustment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -118,6 +136,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -130,6 +149,7 @@ public void setAmount(Amount amount) { */ public AmountAdjustment amountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set return this; } @@ -157,6 +177,7 @@ public AmountAdjustmentTypeEnum getAmountAdjustmentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set } /** @@ -167,6 +188,7 @@ public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentTyp */ public AmountAdjustment basepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set return this; } @@ -190,6 +212,27 @@ public Integer getBasepoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountAdjustment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AmountAdjustment object is equal to o. */ @@ -203,13 +246,23 @@ public boolean equals(Object o) { } AmountAdjustment amountAdjustment = (AmountAdjustment) o; return Objects.equals(this.amount, amountAdjustment.amount) + && Objects.equals(this.isSetAmount, amountAdjustment.isSetAmount) && Objects.equals(this.amountAdjustmentType, amountAdjustment.amountAdjustmentType) - && Objects.equals(this.basepoints, amountAdjustment.basepoints); + && Objects.equals( + this.isSetAmountAdjustmentType, amountAdjustment.isSetAmountAdjustmentType) + && Objects.equals(this.basepoints, amountAdjustment.basepoints) + && Objects.equals(this.isSetBasepoints, amountAdjustment.isSetBasepoints); } @Override public int hashCode() { - return Objects.hash(amount, amountAdjustmentType, basepoints); + return Objects.hash( + amount, + isSetAmount, + amountAdjustmentType, + isSetAmountAdjustmentType, + basepoints, + isSetBasepoints); } @Override @@ -235,6 +288,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustmentType) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE, this.amountAdjustmentType); + } + if (isSetBasepoints) { + addIfNull(nulls, JSON_PROPERTY_BASEPOINTS, this.basepoints); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AmountAdjustment given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/BRLocalAccountIdentification.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/BRLocalAccountIdentification.java index 12730df5f..a8a791c58 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/BRLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class BRLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_ISPB = "ispb"; private String ispb; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIspb = false; + /** **brLocal** */ public enum TypeEnum { BRLOCAL(String.valueOf("brLocal")); @@ -84,6 +98,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BRLocalAccountIdentification() {} /** @@ -94,6 +117,7 @@ public BRLocalAccountIdentification() {} */ public BRLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAccountNumber(String accountNumber) { */ public BRLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setBankCode(String bankCode) { */ public BRLocalAccountIdentification branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -193,6 +222,7 @@ public void setBranchNumber(String branchNumber) { */ public BRLocalAccountIdentification ispb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set return this; } @@ -216,6 +246,7 @@ public String getIspb() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIspb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set } /** @@ -226,6 +257,7 @@ public void setIspb(String ispb) { */ public BRLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -249,6 +281,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BRLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BRLocalAccountIdentification object is equal to o. */ @@ -262,15 +315,30 @@ public boolean equals(Object o) { } BRLocalAccountIdentification brLocalAccountIdentification = (BRLocalAccountIdentification) o; return Objects.equals(this.accountNumber, brLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, brLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bankCode, brLocalAccountIdentification.bankCode) + && Objects.equals(this.isSetBankCode, brLocalAccountIdentification.isSetBankCode) && Objects.equals(this.branchNumber, brLocalAccountIdentification.branchNumber) + && Objects.equals(this.isSetBranchNumber, brLocalAccountIdentification.isSetBranchNumber) && Objects.equals(this.ispb, brLocalAccountIdentification.ispb) - && Objects.equals(this.type, brLocalAccountIdentification.type); + && Objects.equals(this.isSetIspb, brLocalAccountIdentification.isSetIspb) + && Objects.equals(this.type, brLocalAccountIdentification.type) + && Objects.equals(this.isSetType, brLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bankCode, branchNumber, ispb, type); + return Objects.hash( + accountNumber, + isSetAccountNumber, + bankCode, + isSetBankCode, + branchNumber, + isSetBranchNumber, + ispb, + isSetIspb, + type, + isSetType); } @Override @@ -296,6 +364,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetIspb) { + addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BRLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java b/src/main/java/com/adyen/model/java/BalanceMutation.java similarity index 73% rename from src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java rename to src/main/java/com/adyen/model/java/BalanceMutation.java index a23e484bf..e488c48ad 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java +++ b/src/main/java/com/adyen/model/java/BalanceMutation.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class BalanceMutation { public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_RECEIVED = "received"; private Long received; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceived = false; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceMutation() {} /** @@ -49,6 +69,7 @@ public BalanceMutation() {} */ public BalanceMutation balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -76,6 +97,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -88,6 +110,7 @@ public void setBalance(Long balance) { */ public BalanceMutation currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -115,6 +138,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -127,6 +151,7 @@ public void setCurrency(String currency) { */ public BalanceMutation received(Long received) { this.received = received; + isSetReceived = true; // mark as set return this; } @@ -154,6 +179,7 @@ public Long getReceived() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceived(Long received) { this.received = received; + isSetReceived = true; // mark as set } /** @@ -166,6 +192,7 @@ public void setReceived(Long received) { */ public BalanceMutation reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -193,6 +220,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceMutation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceMutation object is equal to o. */ @@ -206,14 +254,26 @@ public boolean equals(Object o) { } BalanceMutation balanceMutation = (BalanceMutation) o; return Objects.equals(this.balance, balanceMutation.balance) + && Objects.equals(this.isSetBalance, balanceMutation.isSetBalance) && Objects.equals(this.currency, balanceMutation.currency) + && Objects.equals(this.isSetCurrency, balanceMutation.isSetCurrency) && Objects.equals(this.received, balanceMutation.received) - && Objects.equals(this.reserved, balanceMutation.reserved); + && Objects.equals(this.isSetReceived, balanceMutation.isSetReceived) + && Objects.equals(this.reserved, balanceMutation.reserved) + && Objects.equals(this.isSetReserved, balanceMutation.isSetReserved); } @Override public int hashCode() { - return Objects.hash(balance, currency, received, reserved); + return Objects.hash( + balance, + isSetBalance, + currency, + isSetCurrency, + received, + isSetReceived, + reserved, + isSetReserved); } @Override @@ -238,6 +298,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetReceived) { + addIfNull(nulls, JSON_PROPERTY_RECEIVED, this.received); + } + if (isSetReserved) { + addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceMutation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/java/BalancePlatformNotificationResponse.java similarity index 66% rename from src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java rename to src/main/java/com/adyen/model/java/BalancePlatformNotificationResponse.java index 6f13538f7..e774b7e00 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/java/BalancePlatformNotificationResponse.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +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. */ @@ -77,12 +110,15 @@ public boolean equals(Object o) { BalancePlatformNotificationResponse balancePlatformNotificationResponse = (BalancePlatformNotificationResponse) o; return Objects.equals( - this.notificationResponse, balancePlatformNotificationResponse.notificationResponse); + this.notificationResponse, balancePlatformNotificationResponse.notificationResponse) + && Objects.equals( + this.isSetNotificationResponse, + balancePlatformNotificationResponse.isSetNotificationResponse); } @Override public int hashCode() { - return Objects.hash(notificationResponse); + return Objects.hash(notificationResponse, isSetNotificationResponse); } @Override @@ -106,6 +142,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/java/BankAccountV3.java similarity index 67% rename from src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java rename to src/main/java/com/adyen/model/java/BankAccountV3.java index 53e309721..1d4123e61 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java +++ b/src/main/java/com/adyen/model/java/BankAccountV3.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +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 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() {} /** @@ -43,6 +60,7 @@ public BankAccountV3() {} */ public BankAccountV3 accountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -66,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 } /** @@ -77,6 +96,7 @@ public void setAccountHolder(PartyIdentification accountHolder) { public BankAccountV3 accountIdentification( BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -100,6 +120,7 @@ public BankAccountV3AccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set } /** @@ -112,6 +133,7 @@ public void setAccountIdentification(BankAccountV3AccountIdentification accountI */ public BankAccountV3 storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -139,6 +161,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 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. */ @@ -152,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 @@ -186,6 +239,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankAccountV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3AccountIdentification.java b/src/main/java/com/adyen/model/java/BankAccountV3AccountIdentification.java similarity index 99% rename from src/main/java/com/adyen/model/transferwebhooks/BankAccountV3AccountIdentification.java rename to src/main/java/com/adyen/model/java/BankAccountV3AccountIdentification.java index 8b8a56abf..45b6b667f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3AccountIdentification.java +++ b/src/main/java/com/adyen/model/java/BankAccountV3AccountIdentification.java @@ -9,7 +9,7 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java b/src/main/java/com/adyen/model/java/BankCategoryData.java similarity index 84% rename from src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java rename to src/main/java/com/adyen/model/java/BankCategoryData.java index 8365dfedd..415e2f62f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java +++ b/src/main/java/com/adyen/model/java/BankCategoryData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -88,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,6 +135,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = 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() {} /** @@ -160,6 +174,7 @@ public BankCategoryData() {} */ public BankCategoryData priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } @@ -223,6 +238,7 @@ public PriorityEnum getPriority() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -233,6 +249,7 @@ public void setPriority(PriorityEnum priority) { */ public BankCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -256,6 +273,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankCategoryData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankCategoryData object is equal to o. */ @@ -269,12 +307,14 @@ public boolean equals(Object o) { } BankCategoryData bankCategoryData = (BankCategoryData) o; return Objects.equals(this.priority, bankCategoryData.priority) - && Objects.equals(this.type, bankCategoryData.type); + && Objects.equals(this.isSetPriority, bankCategoryData.isSetPriority) + && Objects.equals(this.type, bankCategoryData.type) + && Objects.equals(this.isSetType, bankCategoryData.isSetType); } @Override public int hashCode() { - return Objects.hash(priority, type); + return Objects.hash(priority, isSetPriority, type, isSetType); } @Override @@ -297,6 +337,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/java/CALocalAccountIdentification.java similarity index 75% rename from src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/CALocalAccountIdentification.java index e1c0ce47d..9126b1aec 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/CALocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,6 +35,9 @@ public class CALocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -79,12 +84,21 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_INSTITUTION_NUMBER = "institutionNumber"; private String institutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; private String transitNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + /** **caLocal** */ public enum TypeEnum { CALOCAL(String.valueOf("caLocal")); @@ -127,6 +141,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CALocalAccountIdentification() {} /** @@ -137,6 +160,7 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -160,6 +184,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -171,6 +196,7 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -196,6 +222,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -206,6 +233,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set return this; } @@ -229,6 +257,7 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set } /** @@ -239,6 +268,7 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set return this; } @@ -262,6 +292,7 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set } /** @@ -272,6 +303,7 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -295,6 +327,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CALocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CALocalAccountIdentification object is equal to o. */ @@ -308,15 +361,31 @@ public boolean equals(Object o) { } CALocalAccountIdentification caLocalAccountIdentification = (CALocalAccountIdentification) o; return Objects.equals(this.accountNumber, caLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, caLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.accountType, caLocalAccountIdentification.accountType) + && Objects.equals(this.isSetAccountType, caLocalAccountIdentification.isSetAccountType) && Objects.equals(this.institutionNumber, caLocalAccountIdentification.institutionNumber) + && Objects.equals( + this.isSetInstitutionNumber, caLocalAccountIdentification.isSetInstitutionNumber) && Objects.equals(this.transitNumber, caLocalAccountIdentification.transitNumber) - && Objects.equals(this.type, caLocalAccountIdentification.type); + && Objects.equals(this.isSetTransitNumber, caLocalAccountIdentification.isSetTransitNumber) + && Objects.equals(this.type, caLocalAccountIdentification.type) + && Objects.equals(this.isSetType, caLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, accountType, institutionNumber, transitNumber, type); + return Objects.hash( + accountNumber, + isSetAccountNumber, + accountType, + isSetAccountType, + institutionNumber, + isSetInstitutionNumber, + transitNumber, + isSetTransitNumber, + type, + isSetType); } @Override @@ -342,6 +411,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/CZLocalAccountIdentification.java similarity index 77% rename from src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/CZLocalAccountIdentification.java index a46f58f0b..7716c0dcd 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/CZLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class CZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **czLocal** */ public enum TypeEnum { CZLOCAL(String.valueOf("czLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CZLocalAccountIdentification() {} /** @@ -94,6 +111,7 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -133,6 +151,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CZLocalAccountIdentification object is equal to o. */ @@ -212,13 +255,17 @@ public boolean equals(Object o) { } CZLocalAccountIdentification czLocalAccountIdentification = (CZLocalAccountIdentification) o; return Objects.equals(this.accountNumber, czLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, czLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bankCode, czLocalAccountIdentification.bankCode) - && Objects.equals(this.type, czLocalAccountIdentification.type); + && Objects.equals(this.isSetBankCode, czLocalAccountIdentification.isSetBankCode) + && Objects.equals(this.type, czLocalAccountIdentification.type) + && Objects.equals(this.isSetType, czLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bankCode, type); + return Objects.hash( + accountNumber, isSetAccountNumber, bankCode, isSetBankCode, type, isSetType); } @Override @@ -242,6 +289,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Card.java b/src/main/java/com/adyen/model/java/Card.java similarity index 63% rename from src/main/java/com/adyen/model/transferwebhooks/Card.java rename to src/main/java/com/adyen/model/java/Card.java index f7fe6a73b..4fe36e7c7 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Card.java +++ b/src/main/java/com/adyen/model/java/Card.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Card { public static final String JSON_PROPERTY_CARD_HOLDER = "cardHolder"; private PartyIdentification cardHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolder = false; + public static final String JSON_PROPERTY_CARD_IDENTIFICATION = "cardIdentification"; private CardIdentification cardIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIdentification = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Card() {} /** @@ -36,6 +50,7 @@ public Card() {} */ public Card cardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set return this; } @@ -59,6 +74,7 @@ public PartyIdentification getCardHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCardHolder(PartyIdentification cardHolder) { */ public Card cardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set return this; } @@ -92,6 +109,27 @@ public CardIdentification getCardIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Card includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Card object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } Card card = (Card) o; return Objects.equals(this.cardHolder, card.cardHolder) - && Objects.equals(this.cardIdentification, card.cardIdentification); + && Objects.equals(this.isSetCardHolder, card.isSetCardHolder) + && Objects.equals(this.cardIdentification, card.cardIdentification) + && Objects.equals(this.isSetCardIdentification, card.isSetCardIdentification); } @Override public int hashCode() { - return Objects.hash(cardHolder, cardIdentification); + return Objects.hash(cardHolder, isSetCardHolder, cardIdentification, isSetCardIdentification); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardHolder) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER, this.cardHolder); + } + if (isSetCardIdentification) { + addIfNull(nulls, JSON_PROPERTY_CARD_IDENTIFICATION, this.cardIdentification); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Card given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java b/src/main/java/com/adyen/model/java/CardIdentification.java similarity index 76% rename from src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java rename to src/main/java/com/adyen/model/java/CardIdentification.java index 5b6e43a02..9aeac09db 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java +++ b/src/main/java/com/adyen/model/java/CardIdentification.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,24 +33,51 @@ public class CardIdentification { public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_ISSUE_NUMBER = "issueNumber"; private String issueNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssueNumber = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_START_MONTH = "startMonth"; private String startMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartMonth = false; + public static final String JSON_PROPERTY_START_YEAR = "startYear"; private String startYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartYear = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardIdentification() {} /** @@ -61,6 +90,7 @@ public CardIdentification() {} */ public CardIdentification expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -88,6 +118,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -98,6 +129,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardIdentification expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -121,6 +153,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -131,6 +164,7 @@ public void setExpiryYear(String expiryYear) { */ public CardIdentification issueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set return this; } @@ -154,6 +188,7 @@ public String getIssueNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set } /** @@ -166,6 +201,7 @@ public void setIssueNumber(String issueNumber) { */ public CardIdentification number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -193,6 +229,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -206,6 +243,7 @@ public void setNumber(String number) { */ public CardIdentification startMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set return this; } @@ -235,6 +273,7 @@ public String getStartMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set } /** @@ -247,6 +286,7 @@ public void setStartMonth(String startMonth) { */ public CardIdentification startYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set return this; } @@ -274,6 +314,7 @@ public String getStartYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set } /** @@ -288,6 +329,7 @@ public void setStartYear(String startYear) { */ public CardIdentification storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -319,6 +361,27 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardIdentification object is equal to o. */ @@ -332,18 +395,39 @@ public boolean equals(Object o) { } CardIdentification cardIdentification = (CardIdentification) o; return Objects.equals(this.expiryMonth, cardIdentification.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, cardIdentification.isSetExpiryMonth) && Objects.equals(this.expiryYear, cardIdentification.expiryYear) + && Objects.equals(this.isSetExpiryYear, cardIdentification.isSetExpiryYear) && Objects.equals(this.issueNumber, cardIdentification.issueNumber) + && Objects.equals(this.isSetIssueNumber, cardIdentification.isSetIssueNumber) && Objects.equals(this.number, cardIdentification.number) + && Objects.equals(this.isSetNumber, cardIdentification.isSetNumber) && Objects.equals(this.startMonth, cardIdentification.startMonth) + && Objects.equals(this.isSetStartMonth, cardIdentification.isSetStartMonth) && Objects.equals(this.startYear, cardIdentification.startYear) - && Objects.equals(this.storedPaymentMethodId, cardIdentification.storedPaymentMethodId); + && Objects.equals(this.isSetStartYear, cardIdentification.isSetStartYear) + && Objects.equals(this.storedPaymentMethodId, cardIdentification.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, cardIdentification.isSetStoredPaymentMethodId); } @Override public int hashCode() { return Objects.hash( - expiryMonth, expiryYear, issueNumber, number, startMonth, startYear, storedPaymentMethodId); + expiryMonth, + isSetExpiryMonth, + expiryYear, + isSetExpiryYear, + issueNumber, + isSetIssueNumber, + number, + isSetNumber, + startMonth, + isSetStartMonth, + startYear, + isSetStartYear, + storedPaymentMethodId, + isSetStoredPaymentMethodId); } @Override @@ -373,6 +457,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetIssueNumber) { + addIfNull(nulls, JSON_PROPERTY_ISSUE_NUMBER, this.issueNumber); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetStartMonth) { + addIfNull(nulls, JSON_PROPERTY_START_MONTH, this.startMonth); + } + if (isSetStartYear) { + addIfNull(nulls, JSON_PROPERTY_START_YEAR, this.startYear); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java b/src/main/java/com/adyen/model/java/ConfirmationTrackingData.java similarity index 78% rename from src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java rename to src/main/java/com/adyen/model/java/ConfirmationTrackingData.java index 37c66d92c..97a37de1c 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java +++ b/src/main/java/com/adyen/model/java/ConfirmationTrackingData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -75,6 +77,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The type of the tracking event. Possible values: - **confirmation**: the transfer passed * Adyen's internal review. @@ -120,6 +125,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ConfirmationTrackingData() {} /** @@ -134,6 +148,7 @@ public ConfirmationTrackingData() {} */ public ConfirmationTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -165,6 +180,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -177,6 +193,7 @@ public void setStatus(StatusEnum status) { */ public ConfirmationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -204,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ConfirmationTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ConfirmationTrackingData object is equal to o. */ @@ -217,12 +255,14 @@ public boolean equals(Object o) { } ConfirmationTrackingData confirmationTrackingData = (ConfirmationTrackingData) o; return Objects.equals(this.status, confirmationTrackingData.status) - && Objects.equals(this.type, confirmationTrackingData.type); + && Objects.equals(this.isSetStatus, confirmationTrackingData.isSetStatus) + && Objects.equals(this.type, confirmationTrackingData.type) + && Objects.equals(this.isSetType, confirmationTrackingData.isSetType); } @Override public int hashCode() { - return Objects.hash(status, type); + return Objects.hash(status, isSetStatus, type, isSetType); } @Override @@ -245,6 +285,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ConfirmationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java b/src/main/java/com/adyen/model/java/CounterpartyV3.java similarity index 71% rename from src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java rename to src/main/java/com/adyen/model/java/CounterpartyV3.java index bb8a1a793..2eec13cb7 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java +++ b/src/main/java/com/adyen/model/java/CounterpartyV3.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class CounterpartyV3 { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_MERCHANT = "merchant"; private MerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyV3() {} /** @@ -53,6 +76,7 @@ public CounterpartyV3() {} */ public CounterpartyV3 balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -80,6 +104,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -90,6 +115,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public CounterpartyV3 bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -113,6 +139,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -123,6 +150,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public CounterpartyV3 card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -146,6 +174,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -156,6 +185,7 @@ public void setCard(Card card) { */ public CounterpartyV3 merchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -179,6 +209,7 @@ public MerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -191,6 +222,7 @@ public void setMerchant(MerchantData merchant) { */ public CounterpartyV3 transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -218,6 +250,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyV3 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CounterpartyV3 object is equal to o. */ @@ -231,15 +284,30 @@ public boolean equals(Object o) { } CounterpartyV3 counterpartyV3 = (CounterpartyV3) o; return Objects.equals(this.balanceAccountId, counterpartyV3.balanceAccountId) + && Objects.equals(this.isSetBalanceAccountId, counterpartyV3.isSetBalanceAccountId) && Objects.equals(this.bankAccount, counterpartyV3.bankAccount) + && Objects.equals(this.isSetBankAccount, counterpartyV3.isSetBankAccount) && Objects.equals(this.card, counterpartyV3.card) + && Objects.equals(this.isSetCard, counterpartyV3.isSetCard) && Objects.equals(this.merchant, counterpartyV3.merchant) - && Objects.equals(this.transferInstrumentId, counterpartyV3.transferInstrumentId); + && Objects.equals(this.isSetMerchant, counterpartyV3.isSetMerchant) + && Objects.equals(this.transferInstrumentId, counterpartyV3.transferInstrumentId) + && Objects.equals(this.isSetTransferInstrumentId, counterpartyV3.isSetTransferInstrumentId); } @Override public int hashCode() { - return Objects.hash(balanceAccountId, bankAccount, card, merchant, transferInstrumentId); + return Objects.hash( + balanceAccountId, + isSetBalanceAccountId, + bankAccount, + isSetBankAccount, + card, + isSetCard, + merchant, + isSetMerchant, + transferInstrumentId, + isSetTransferInstrumentId); } @Override @@ -267,6 +335,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CounterpartyV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/DKLocalAccountIdentification.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/DKLocalAccountIdentification.java index 86a651b02..fe7107bd3 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/DKLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class DKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **dkLocal** */ public enum TypeEnum { DKLOCAL(String.valueOf("dkLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DKLocalAccountIdentification() {} /** @@ -87,6 +104,7 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -112,6 +130,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DKLocalAccountIdentification object is equal to o. */ @@ -192,13 +235,17 @@ public boolean equals(Object o) { } DKLocalAccountIdentification dkLocalAccountIdentification = (DKLocalAccountIdentification) o; return Objects.equals(this.accountNumber, dkLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, dkLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bankCode, dkLocalAccountIdentification.bankCode) - && Objects.equals(this.type, dkLocalAccountIdentification.type); + && Objects.equals(this.isSetBankCode, dkLocalAccountIdentification.isSetBankCode) + && Objects.equals(this.type, dkLocalAccountIdentification.type) + && Objects.equals(this.isSetType, dkLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bankCode, type); + return Objects.hash( + accountNumber, isSetAccountNumber, bankCode, isSetBankCode, type, isSetType); } @Override @@ -222,6 +269,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java b/src/main/java/com/adyen/model/java/DirectDebitInformation.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java rename to src/main/java/com/adyen/model/java/DirectDebitInformation.java index c4944dac4..bcfa30f1a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java +++ b/src/main/java/com/adyen/model/java/DirectDebitInformation.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,15 +31,33 @@ public class DirectDebitInformation { public static final String JSON_PROPERTY_DATE_OF_SIGNATURE = "dateOfSignature"; private OffsetDateTime dateOfSignature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfSignature = false; + public static final String JSON_PROPERTY_DUE_DATE = "dueDate"; private OffsetDateTime dueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDueDate = false; + public static final String JSON_PROPERTY_MANDATE_ID = "mandateId"; private String mandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandateId = false; + public static final String JSON_PROPERTY_SEQUENCE_TYPE = "sequenceType"; private String sequenceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DirectDebitInformation() {} /** @@ -50,6 +70,7 @@ public DirectDebitInformation() {} */ public DirectDebitInformation dateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set return this; } @@ -77,6 +98,7 @@ public OffsetDateTime getDateOfSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set } /** @@ -87,6 +109,7 @@ public void setDateOfSignature(OffsetDateTime dateOfSignature) { */ public DirectDebitInformation dueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set return this; } @@ -110,6 +133,7 @@ public OffsetDateTime getDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set } /** @@ -120,6 +144,7 @@ public void setDueDate(OffsetDateTime dueDate) { */ public DirectDebitInformation mandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set return this; } @@ -143,6 +168,7 @@ public String getMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set } /** @@ -155,6 +181,7 @@ public void setMandateId(String mandateId) { */ public DirectDebitInformation sequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set return this; } @@ -182,6 +209,27 @@ public String getSequenceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DirectDebitInformation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DirectDebitInformation object is equal to o. */ @@ -195,14 +243,26 @@ public boolean equals(Object o) { } DirectDebitInformation directDebitInformation = (DirectDebitInformation) o; return Objects.equals(this.dateOfSignature, directDebitInformation.dateOfSignature) + && Objects.equals(this.isSetDateOfSignature, directDebitInformation.isSetDateOfSignature) && Objects.equals(this.dueDate, directDebitInformation.dueDate) + && Objects.equals(this.isSetDueDate, directDebitInformation.isSetDueDate) && Objects.equals(this.mandateId, directDebitInformation.mandateId) - && Objects.equals(this.sequenceType, directDebitInformation.sequenceType); + && Objects.equals(this.isSetMandateId, directDebitInformation.isSetMandateId) + && Objects.equals(this.sequenceType, directDebitInformation.sequenceType) + && Objects.equals(this.isSetSequenceType, directDebitInformation.isSetSequenceType); } @Override public int hashCode() { - return Objects.hash(dateOfSignature, dueDate, mandateId, sequenceType); + return Objects.hash( + dateOfSignature, + isSetDateOfSignature, + dueDate, + isSetDueDate, + mandateId, + isSetMandateId, + sequenceType, + isSetSequenceType); } @Override @@ -227,6 +287,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDateOfSignature) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_SIGNATURE, this.dateOfSignature); + } + if (isSetDueDate) { + addIfNull(nulls, JSON_PROPERTY_DUE_DATE, this.dueDate); + } + if (isSetMandateId) { + addIfNull(nulls, JSON_PROPERTY_MANDATE_ID, this.mandateId); + } + if (isSetSequenceType) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_TYPE, this.sequenceType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DirectDebitInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java b/src/main/java/com/adyen/model/java/EstimationTrackingData.java similarity index 74% rename from src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java rename to src/main/java/com/adyen/model/java/EstimationTrackingData.java index 15e7f11e8..3b38c1872 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java +++ b/src/main/java/com/adyen/model/java/EstimationTrackingData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class EstimationTrackingData { public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + /** * The type of tracking event. Possible values: - **estimation**: the estimated date and time of * when the funds will be credited has been determined. @@ -76,6 +81,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EstimationTrackingData() {} /** @@ -86,6 +100,7 @@ public EstimationTrackingData() {} */ public EstimationTrackingData estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -110,6 +125,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -122,6 +138,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public EstimationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -149,6 +166,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EstimationTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EstimationTrackingData object is equal to o. */ @@ -162,12 +200,15 @@ public boolean equals(Object o) { } EstimationTrackingData estimationTrackingData = (EstimationTrackingData) o; return Objects.equals(this.estimatedArrivalTime, estimationTrackingData.estimatedArrivalTime) - && Objects.equals(this.type, estimationTrackingData.type); + && Objects.equals( + this.isSetEstimatedArrivalTime, estimationTrackingData.isSetEstimatedArrivalTime) + && Objects.equals(this.type, estimationTrackingData.type) + && Objects.equals(this.isSetType, estimationTrackingData.isSetType); } @Override public int hashCode() { - return Objects.hash(estimatedArrivalTime, type); + return Objects.hash(estimatedArrivalTime, isSetEstimatedArrivalTime, type, isSetType); } @Override @@ -192,6 +233,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EstimationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java b/src/main/java/com/adyen/model/java/ExecutionDate.java similarity index 75% rename from src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java rename to src/main/java/com/adyen/model/java/ExecutionDate.java index 7590e2320..ce32ff149 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java +++ b/src/main/java/com/adyen/model/java/ExecutionDate.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -24,9 +26,21 @@ public class ExecutionDate { public static final String JSON_PROPERTY_DATE = "date"; private LocalDate date; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDate = false; + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; private String timezone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimezone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExecutionDate() {} /** @@ -43,6 +57,7 @@ public ExecutionDate() {} */ public ExecutionDate date(LocalDate date) { this.date = date; + isSetDate = true; // mark as set return this; } @@ -78,6 +93,7 @@ public LocalDate getDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDate(LocalDate date) { this.date = date; + isSetDate = true; // mark as set } /** @@ -92,6 +108,7 @@ public void setDate(LocalDate date) { */ public ExecutionDate timezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set return this; } @@ -123,6 +140,27 @@ public String getTimezone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExecutionDate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ExecutionDate object is equal to o. */ @@ -136,12 +174,14 @@ public boolean equals(Object o) { } ExecutionDate executionDate = (ExecutionDate) o; return Objects.equals(this.date, executionDate.date) - && Objects.equals(this.timezone, executionDate.timezone); + && Objects.equals(this.isSetDate, executionDate.isSetDate) + && Objects.equals(this.timezone, executionDate.timezone) + && Objects.equals(this.isSetTimezone, executionDate.isSetTimezone); } @Override public int hashCode() { - return Objects.hash(date, timezone); + return Objects.hash(date, isSetDate, timezone, isSetTimezone); } @Override @@ -164,6 +204,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDate) { + addIfNull(nulls, JSON_PROPERTY_DATE, this.date); + } + if (isSetTimezone) { + addIfNull(nulls, JSON_PROPERTY_TIMEZONE, this.timezone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ExecutionDate given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java b/src/main/java/com/adyen/model/java/ExternalReason.java similarity index 66% rename from src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java rename to src/main/java/com/adyen/model/java/ExternalReason.java index 23eb589fe..5b0a473a6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java +++ b/src/main/java/com/adyen/model/java/ExternalReason.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ExternalReason { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; private String namespace; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNamespace = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExternalReason() {} /** @@ -43,6 +60,7 @@ public ExternalReason() {} */ public ExternalReason code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCode(String code) { */ public ExternalReason description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setDescription(String description) { */ public ExternalReason namespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getNamespace() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNamespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExternalReason includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ExternalReason object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } ExternalReason externalReason = (ExternalReason) o; return Objects.equals(this.code, externalReason.code) + && Objects.equals(this.isSetCode, externalReason.isSetCode) && Objects.equals(this.description, externalReason.description) - && Objects.equals(this.namespace, externalReason.namespace); + && Objects.equals(this.isSetDescription, externalReason.isSetDescription) + && Objects.equals(this.namespace, externalReason.namespace) + && Objects.equals(this.isSetNamespace, externalReason.isSetNamespace); } @Override public int hashCode() { - return Objects.hash(code, description, namespace); + return Objects.hash(code, isSetCode, description, isSetDescription, namespace, isSetNamespace); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetNamespace) { + addIfNull(nulls, JSON_PROPERTY_NAMESPACE, this.namespace); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ExternalReason given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/HKLocalAccountIdentification.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/HKLocalAccountIdentification.java index 01fcbfd81..3350b8894 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/HKLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class HKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; private String clearingCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + /** **hkLocal** */ public enum TypeEnum { HKLOCAL(String.valueOf("hkLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public HKLocalAccountIdentification() {} /** @@ -88,6 +105,7 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -115,6 +133,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this HKLocalAccountIdentification object is equal to o. */ @@ -194,13 +237,17 @@ public boolean equals(Object o) { } HKLocalAccountIdentification hkLocalAccountIdentification = (HKLocalAccountIdentification) o; return Objects.equals(this.accountNumber, hkLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, hkLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.clearingCode, hkLocalAccountIdentification.clearingCode) - && Objects.equals(this.type, hkLocalAccountIdentification.type); + && Objects.equals(this.isSetClearingCode, hkLocalAccountIdentification.isSetClearingCode) + && Objects.equals(this.type, hkLocalAccountIdentification.type) + && Objects.equals(this.isSetType, hkLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, clearingCode, type); + return Objects.hash( + accountNumber, isSetAccountNumber, clearingCode, isSetClearingCode, type, isSetType); } @Override @@ -224,6 +271,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/java/HULocalAccountIdentification.java similarity index 70% rename from src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/HULocalAccountIdentification.java index fccfad5ec..8c4282824 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/HULocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class HULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **huLocal** */ public enum TypeEnum { HULOCAL(String.valueOf("huLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public HULocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this HULocalAccountIdentification object is equal to o. */ @@ -151,12 +189,14 @@ public boolean equals(Object o) { } HULocalAccountIdentification huLocalAccountIdentification = (HULocalAccountIdentification) o; return Objects.equals(this.accountNumber, huLocalAccountIdentification.accountNumber) - && Objects.equals(this.type, huLocalAccountIdentification.type); + && Objects.equals(this.isSetAccountNumber, huLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, huLocalAccountIdentification.type) + && Objects.equals(this.isSetType, huLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, type); + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType); } @Override @@ -179,6 +219,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java b/src/main/java/com/adyen/model/java/IbanAccountIdentification.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java rename to src/main/java/com/adyen/model/java/IbanAccountIdentification.java index 3d44f7cc4..777ae67d2 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/IbanAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IbanAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IbanAccountIdentification object is equal to o. */ @@ -157,12 +195,14 @@ public boolean equals(Object o) { } IbanAccountIdentification ibanAccountIdentification = (IbanAccountIdentification) o; return Objects.equals(this.iban, ibanAccountIdentification.iban) - && Objects.equals(this.type, ibanAccountIdentification.type); + && Objects.equals(this.isSetIban, ibanAccountIdentification.isSetIban) + && Objects.equals(this.type, ibanAccountIdentification.type) + && Objects.equals(this.isSetType, ibanAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(iban, type); + return Objects.hash(iban, isSetIban, type, isSetType); } @Override @@ -185,6 +225,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InterchangeData.java b/src/main/java/com/adyen/model/java/InterchangeData.java similarity index 74% rename from src/main/java/com/adyen/model/transferwebhooks/InterchangeData.java rename to src/main/java/com/adyen/model/java/InterchangeData.java index 3446e6ea0..2364c048c 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InterchangeData.java +++ b/src/main/java/com/adyen/model/java/InterchangeData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +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 InterchangeData { public static final String JSON_PROPERTY_INTERCHANGE_AMOUNT = "interchangeAmount"; private Amount interchangeAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterchangeAmount = false; + public static final String JSON_PROPERTY_INTERCHANGE_RATE_INDICATOR = "interchangeRateIndicator"; private String interchangeRateIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterchangeRateIndicator = false; + /** * The type of events data. Possible values: - **interchangeData**: information about the * interchange fee applied to a transaction. @@ -79,6 +87,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InterchangeData() {} /** @@ -89,6 +106,7 @@ public InterchangeData() {} */ public InterchangeData interchangeAmount(Amount interchangeAmount) { this.interchangeAmount = interchangeAmount; + isSetInterchangeAmount = true; // mark as set return this; } @@ -112,6 +130,7 @@ public Amount getInterchangeAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterchangeAmount(Amount interchangeAmount) { this.interchangeAmount = interchangeAmount; + isSetInterchangeAmount = true; // mark as set } /** @@ -126,6 +145,7 @@ public void setInterchangeAmount(Amount interchangeAmount) { */ public InterchangeData interchangeRateIndicator(String interchangeRateIndicator) { this.interchangeRateIndicator = interchangeRateIndicator; + isSetInterchangeRateIndicator = true; // mark as set return this; } @@ -157,6 +177,7 @@ public String getInterchangeRateIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterchangeRateIndicator(String interchangeRateIndicator) { this.interchangeRateIndicator = interchangeRateIndicator; + isSetInterchangeRateIndicator = true; // mark as set } /** @@ -169,6 +190,7 @@ public void setInterchangeRateIndicator(String interchangeRateIndicator) { */ public InterchangeData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -196,6 +218,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InterchangeData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InterchangeData object is equal to o. */ @@ -209,13 +252,23 @@ public boolean equals(Object o) { } InterchangeData interchangeData = (InterchangeData) o; return Objects.equals(this.interchangeAmount, interchangeData.interchangeAmount) + && Objects.equals(this.isSetInterchangeAmount, interchangeData.isSetInterchangeAmount) && Objects.equals(this.interchangeRateIndicator, interchangeData.interchangeRateIndicator) - && Objects.equals(this.type, interchangeData.type); + && Objects.equals( + this.isSetInterchangeRateIndicator, interchangeData.isSetInterchangeRateIndicator) + && Objects.equals(this.type, interchangeData.type) + && Objects.equals(this.isSetType, interchangeData.isSetType); } @Override public int hashCode() { - return Objects.hash(interchangeAmount, interchangeRateIndicator, type); + return Objects.hash( + interchangeAmount, + isSetInterchangeAmount, + interchangeRateIndicator, + isSetInterchangeRateIndicator, + type, + isSetType); } @Override @@ -241,6 +294,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetInterchangeAmount) { + addIfNull(nulls, JSON_PROPERTY_INTERCHANGE_AMOUNT, this.interchangeAmount); + } + if (isSetInterchangeRateIndicator) { + addIfNull(nulls, JSON_PROPERTY_INTERCHANGE_RATE_INDICATOR, this.interchangeRateIndicator); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InterchangeData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java b/src/main/java/com/adyen/model/java/InternalCategoryData.java similarity index 70% rename from src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java rename to src/main/java/com/adyen/model/java/InternalCategoryData.java index 3139106aa..168820727 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java +++ b/src/main/java/com/adyen/model/java/InternalCategoryData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +34,15 @@ public class InternalCategoryData { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + /** **internal** */ public enum TypeEnum { INTERNAL(String.valueOf("internal")); @@ -77,6 +85,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InternalCategoryData() {} /** @@ -88,6 +105,7 @@ public InternalCategoryData() {} */ public InternalCategoryData modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -113,6 +131,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public InternalCategoryData modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public InternalCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InternalCategoryData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InternalCategoryData object is equal to o. */ @@ -193,14 +236,26 @@ public boolean equals(Object o) { InternalCategoryData internalCategoryData = (InternalCategoryData) o; return Objects.equals( this.modificationMerchantReference, internalCategoryData.modificationMerchantReference) + && Objects.equals( + this.isSetModificationMerchantReference, + internalCategoryData.isSetModificationMerchantReference) && Objects.equals( this.modificationPspReference, internalCategoryData.modificationPspReference) - && Objects.equals(this.type, internalCategoryData.type); + && Objects.equals( + this.isSetModificationPspReference, internalCategoryData.isSetModificationPspReference) + && Objects.equals(this.type, internalCategoryData.type) + && Objects.equals(this.isSetType, internalCategoryData.isSetType); } @Override public int hashCode() { - return Objects.hash(modificationMerchantReference, modificationPspReference, type); + return Objects.hash( + modificationMerchantReference, + isSetModificationMerchantReference, + modificationPspReference, + isSetModificationPspReference, + type, + isSetType); } @Override @@ -228,6 +283,37 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InternalCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java b/src/main/java/com/adyen/model/java/InternalReviewTrackingData.java similarity index 82% rename from src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java rename to src/main/java/com/adyen/model/java/InternalReviewTrackingData.java index a67616193..d0bf91950 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java +++ b/src/main/java/com/adyen/model/java/InternalReviewTrackingData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -74,6 +76,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** * The status of the transfer. Possible values: - **pending**: the transfer is under internal * review by Adyen. - **failed**: the transfer failed Adyen's internal review. For details, @@ -122,6 +127,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The type of tracking event. Possible values: - **internalReview**: the transfer was flagged * because it does not comply with Adyen's risk policy. @@ -167,6 +175,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InternalReviewTrackingData() {} /** @@ -182,6 +199,7 @@ public InternalReviewTrackingData() {} */ public InternalReviewTrackingData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -215,6 +233,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -229,6 +248,7 @@ public void setReason(ReasonEnum reason) { */ public InternalReviewTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -260,6 +280,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -272,6 +293,7 @@ public void setStatus(StatusEnum status) { */ public InternalReviewTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -299,6 +321,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InternalReviewTrackingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InternalReviewTrackingData object is equal to o. */ @@ -312,13 +355,16 @@ public boolean equals(Object o) { } InternalReviewTrackingData internalReviewTrackingData = (InternalReviewTrackingData) o; return Objects.equals(this.reason, internalReviewTrackingData.reason) + && Objects.equals(this.isSetReason, internalReviewTrackingData.isSetReason) && Objects.equals(this.status, internalReviewTrackingData.status) - && Objects.equals(this.type, internalReviewTrackingData.type); + && Objects.equals(this.isSetStatus, internalReviewTrackingData.isSetStatus) + && Objects.equals(this.type, internalReviewTrackingData.type) + && Objects.equals(this.isSetType, internalReviewTrackingData.isSetType); } @Override public int hashCode() { - return Objects.hash(reason, status, type); + return Objects.hash(reason, isSetReason, status, isSetStatus, type, isSetType); } @Override @@ -342,6 +388,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InternalReviewTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java b/src/main/java/com/adyen/model/java/IssuedCard.java similarity index 81% rename from src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java rename to src/main/java/com/adyen/model/java/IssuedCard.java index b464f625f..febce4a57 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java +++ b/src/main/java/com/adyen/model/java/IssuedCard.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,6 +41,9 @@ public class IssuedCard { public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; private String authorisationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationType = false; + /** * Indicates the method used for entering the PAN to initiate a transaction. Possible values: * **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. @@ -96,6 +101,9 @@ public static PanEntryModeEnum fromValue(String value) { public static final String JSON_PROPERTY_PAN_ENTRY_MODE = "panEntryMode"; private PanEntryModeEnum panEntryMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPanEntryMode = false; + /** * Contains information about how the payment was processed. For example, **ecommerce** for online * or **pos** for in-person payments. @@ -155,19 +163,34 @@ public static ProcessingTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PROCESSING_TYPE = "processingType"; private ProcessingTypeEnum processingType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProcessingType = false; + public static final String JSON_PROPERTY_RELAYED_AUTHORISATION_DATA = "relayedAuthorisationData"; private RelayedAuthorisationData relayedAuthorisationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRelayedAuthorisationData = false; + public static final String JSON_PROPERTY_SCHEME_TRACE_ID = "schemeTraceId"; private String schemeTraceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeTraceId = false; + public static final String JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID = "schemeUniqueTransactionId"; private String schemeUniqueTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeUniqueTransactionId = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private ThreeDSecure threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + /** **issuedCard** */ public enum TypeEnum { ISSUEDCARD(String.valueOf("issuedCard")); @@ -210,9 +233,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VALIDATION_FACTS = "validationFacts"; private List validationFacts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidationFacts = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuedCard() {} /** @@ -225,6 +260,7 @@ public IssuedCard() {} */ public IssuedCard authorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set return this; } @@ -252,6 +288,7 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set } /** @@ -265,6 +302,7 @@ public void setAuthorisationType(String authorisationType) { */ public IssuedCard panEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set return this; } @@ -294,6 +332,7 @@ public PanEntryModeEnum getPanEntryMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPanEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set } /** @@ -306,6 +345,7 @@ public void setPanEntryMode(PanEntryModeEnum panEntryMode) { */ public IssuedCard processingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set return this; } @@ -333,6 +373,7 @@ public ProcessingTypeEnum getProcessingType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set } /** @@ -343,6 +384,7 @@ public void setProcessingType(ProcessingTypeEnum processingType) { */ public IssuedCard relayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set return this; } @@ -366,6 +408,7 @@ public RelayedAuthorisationData getRelayedAuthorisationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set } /** @@ -384,6 +427,7 @@ public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthoris */ public IssuedCard schemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set return this; } @@ -423,6 +467,7 @@ public String getSchemeTraceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set } /** @@ -435,6 +480,7 @@ public void setSchemeTraceId(String schemeTraceId) { */ public IssuedCard schemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set return this; } @@ -462,6 +508,7 @@ public String getSchemeUniqueTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set } /** @@ -472,6 +519,7 @@ public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { */ public IssuedCard threeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -495,6 +543,7 @@ public ThreeDSecure getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -505,6 +554,7 @@ public void setThreeDSecure(ThreeDSecure threeDSecure) { */ public IssuedCard type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -528,6 +578,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -540,6 +591,7 @@ public void setType(TypeEnum type) { */ public IssuedCard validationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set return this; } @@ -575,6 +627,27 @@ public List getValidationFacts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuedCard includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IssuedCard object is equal to o. */ @@ -588,28 +661,48 @@ public boolean equals(Object o) { } IssuedCard issuedCard = (IssuedCard) o; return Objects.equals(this.authorisationType, issuedCard.authorisationType) + && Objects.equals(this.isSetAuthorisationType, issuedCard.isSetAuthorisationType) && Objects.equals(this.panEntryMode, issuedCard.panEntryMode) + && Objects.equals(this.isSetPanEntryMode, issuedCard.isSetPanEntryMode) && Objects.equals(this.processingType, issuedCard.processingType) + && Objects.equals(this.isSetProcessingType, issuedCard.isSetProcessingType) && Objects.equals(this.relayedAuthorisationData, issuedCard.relayedAuthorisationData) + && Objects.equals( + this.isSetRelayedAuthorisationData, issuedCard.isSetRelayedAuthorisationData) && Objects.equals(this.schemeTraceId, issuedCard.schemeTraceId) + && Objects.equals(this.isSetSchemeTraceId, issuedCard.isSetSchemeTraceId) && Objects.equals(this.schemeUniqueTransactionId, issuedCard.schemeUniqueTransactionId) + && Objects.equals( + this.isSetSchemeUniqueTransactionId, issuedCard.isSetSchemeUniqueTransactionId) && Objects.equals(this.threeDSecure, issuedCard.threeDSecure) + && Objects.equals(this.isSetThreeDSecure, issuedCard.isSetThreeDSecure) && Objects.equals(this.type, issuedCard.type) - && Objects.equals(this.validationFacts, issuedCard.validationFacts); + && Objects.equals(this.isSetType, issuedCard.isSetType) + && Objects.equals(this.validationFacts, issuedCard.validationFacts) + && Objects.equals(this.isSetValidationFacts, issuedCard.isSetValidationFacts); } @Override public int hashCode() { return Objects.hash( authorisationType, + isSetAuthorisationType, panEntryMode, + isSetPanEntryMode, processingType, + isSetProcessingType, relayedAuthorisationData, + isSetRelayedAuthorisationData, schemeTraceId, + isSetSchemeTraceId, schemeUniqueTransactionId, + isSetSchemeUniqueTransactionId, threeDSecure, + isSetThreeDSecure, type, - validationFacts); + isSetType, + validationFacts, + isSetValidationFacts); } @Override @@ -643,6 +736,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthorisationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); + } + if (isSetPanEntryMode) { + addIfNull(nulls, JSON_PROPERTY_PAN_ENTRY_MODE, this.panEntryMode); + } + if (isSetProcessingType) { + addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPE, this.processingType); + } + if (isSetRelayedAuthorisationData) { + addIfNull(nulls, JSON_PROPERTY_RELAYED_AUTHORISATION_DATA, this.relayedAuthorisationData); + } + if (isSetSchemeTraceId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_TRACE_ID, this.schemeTraceId); + } + if (isSetSchemeUniqueTransactionId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID, this.schemeUniqueTransactionId); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidationFacts) { + addIfNull(nulls, JSON_PROPERTY_VALIDATION_FACTS, this.validationFacts); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IssuedCard given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java b/src/main/java/com/adyen/model/java/IssuingTransactionData.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java rename to src/main/java/com/adyen/model/java/IssuingTransactionData.java index f290bcec6..4a8362f5e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java +++ b/src/main/java/com/adyen/model/java/IssuingTransactionData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class IssuingTransactionData { public static final String JSON_PROPERTY_CAPTURE_CYCLE_ID = "captureCycleId"; private String captureCycleId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureCycleId = false; + /** * The type of events data. Possible values: - **issuingTransactionData**: issuing transaction * data @@ -75,6 +80,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuingTransactionData() {} /** @@ -85,6 +99,7 @@ public IssuingTransactionData() {} */ public IssuingTransactionData captureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set return this; } @@ -108,6 +123,7 @@ public String getCaptureCycleId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set } /** @@ -120,6 +136,7 @@ public void setCaptureCycleId(String captureCycleId) { */ public IssuingTransactionData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -147,6 +164,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuingTransactionData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IssuingTransactionData object is equal to o. */ @@ -160,12 +198,14 @@ public boolean equals(Object o) { } IssuingTransactionData issuingTransactionData = (IssuingTransactionData) o; return Objects.equals(this.captureCycleId, issuingTransactionData.captureCycleId) - && Objects.equals(this.type, issuingTransactionData.type); + && Objects.equals(this.isSetCaptureCycleId, issuingTransactionData.isSetCaptureCycleId) + && Objects.equals(this.type, issuingTransactionData.type) + && Objects.equals(this.isSetType, issuingTransactionData.isSetType); } @Override public int hashCode() { - return Objects.hash(captureCycleId, type); + return Objects.hash(captureCycleId, isSetCaptureCycleId, type, isSetType); } @Override @@ -188,6 +228,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCaptureCycleId) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_CYCLE_ID, this.captureCycleId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IssuingTransactionData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Leg.java b/src/main/java/com/adyen/model/java/Leg.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/Leg.java rename to src/main/java/com/adyen/model/java/Leg.java index 01040e074..96af746d8 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Leg.java +++ b/src/main/java/com/adyen/model/java/Leg.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Leg { public static final String JSON_PROPERTY_ARRIVAL_AIRPORT_CODE = "arrivalAirportCode"; private String arrivalAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArrivalAirportCode = false; + public static final String JSON_PROPERTY_BASIC_FARE_CODE = "basicFareCode"; private String basicFareCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasicFareCode = false; + public static final String JSON_PROPERTY_CARRIER_CODE = "carrierCode"; private String carrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierCode = false; + public static final String JSON_PROPERTY_DEPARTURE_AIRPORT_CODE = "departureAirportCode"; private String departureAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureAirportCode = false; + public static final String JSON_PROPERTY_DEPARTURE_DATE = "departureDate"; private String departureDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureDate = false; + public static final String JSON_PROPERTY_FLIGHT_NUMBER = "flightNumber"; private String flightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Leg() {} /** @@ -57,6 +83,7 @@ public Leg() {} */ public Leg arrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getArrivalAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set } /** @@ -94,6 +122,7 @@ public void setArrivalAirportCode(String arrivalAirportCode) { */ public Leg basicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getBasicFareCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set } /** @@ -127,6 +157,7 @@ public void setBasicFareCode(String basicFareCode) { */ public Leg carrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set return this; } @@ -150,6 +181,7 @@ public String getCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set } /** @@ -162,6 +194,7 @@ public void setCarrierCode(String carrierCode) { */ public Leg departureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set return this; } @@ -189,6 +222,7 @@ public String getDepartureAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set } /** @@ -199,6 +233,7 @@ public void setDepartureAirportCode(String departureAirportCode) { */ public Leg departureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set return this; } @@ -222,6 +257,7 @@ public String getDepartureDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set } /** @@ -232,6 +268,7 @@ public void setDepartureDate(String departureDate) { */ public Leg flightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set return this; } @@ -255,6 +292,27 @@ public String getFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Leg includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Leg object is equal to o. */ @@ -268,22 +326,34 @@ public boolean equals(Object o) { } Leg leg = (Leg) o; return Objects.equals(this.arrivalAirportCode, leg.arrivalAirportCode) + && Objects.equals(this.isSetArrivalAirportCode, leg.isSetArrivalAirportCode) && Objects.equals(this.basicFareCode, leg.basicFareCode) + && Objects.equals(this.isSetBasicFareCode, leg.isSetBasicFareCode) && Objects.equals(this.carrierCode, leg.carrierCode) + && Objects.equals(this.isSetCarrierCode, leg.isSetCarrierCode) && Objects.equals(this.departureAirportCode, leg.departureAirportCode) + && Objects.equals(this.isSetDepartureAirportCode, leg.isSetDepartureAirportCode) && Objects.equals(this.departureDate, leg.departureDate) - && Objects.equals(this.flightNumber, leg.flightNumber); + && Objects.equals(this.isSetDepartureDate, leg.isSetDepartureDate) + && Objects.equals(this.flightNumber, leg.flightNumber) + && Objects.equals(this.isSetFlightNumber, leg.isSetFlightNumber); } @Override public int hashCode() { return Objects.hash( arrivalAirportCode, + isSetArrivalAirportCode, basicFareCode, + isSetBasicFareCode, carrierCode, + isSetCarrierCode, departureAirportCode, + isSetDepartureAirportCode, departureDate, - flightNumber); + isSetDepartureDate, + flightNumber, + isSetFlightNumber); } @Override @@ -312,6 +382,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetArrivalAirportCode) { + addIfNull(nulls, JSON_PROPERTY_ARRIVAL_AIRPORT_CODE, this.arrivalAirportCode); + } + if (isSetBasicFareCode) { + addIfNull(nulls, JSON_PROPERTY_BASIC_FARE_CODE, this.basicFareCode); + } + if (isSetCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_CODE, this.carrierCode); + } + if (isSetDepartureAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_AIRPORT_CODE, this.departureAirportCode); + } + if (isSetDepartureDate) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_DATE, this.departureDate); + } + if (isSetFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_NUMBER, this.flightNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Leg given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Lodging.java b/src/main/java/com/adyen/model/java/Lodging.java similarity index 64% rename from src/main/java/com/adyen/model/transferwebhooks/Lodging.java rename to src/main/java/com/adyen/model/java/Lodging.java index c007d2416..7699e0512 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Lodging.java +++ b/src/main/java/com/adyen/model/java/Lodging.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Lodging { public static final String JSON_PROPERTY_CHECK_IN_DATE = "checkInDate"; private String checkInDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckInDate = false; + public static final String JSON_PROPERTY_NUMBER_OF_NIGHTS = "numberOfNights"; private Integer numberOfNights; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfNights = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Lodging() {} /** @@ -36,6 +50,7 @@ public Lodging() {} */ public Lodging checkInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCheckInDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCheckInDate(String checkInDate) { */ public Lodging numberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set return this; } @@ -92,6 +109,27 @@ public Integer getNumberOfNights() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Lodging includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Lodging object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } Lodging lodging = (Lodging) o; return Objects.equals(this.checkInDate, lodging.checkInDate) - && Objects.equals(this.numberOfNights, lodging.numberOfNights); + && Objects.equals(this.isSetCheckInDate, lodging.isSetCheckInDate) + && Objects.equals(this.numberOfNights, lodging.numberOfNights) + && Objects.equals(this.isSetNumberOfNights, lodging.isSetNumberOfNights); } @Override public int hashCode() { - return Objects.hash(checkInDate, numberOfNights); + return Objects.hash(checkInDate, isSetCheckInDate, numberOfNights, isSetNumberOfNights); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckInDate) { + addIfNull(nulls, JSON_PROPERTY_CHECK_IN_DATE, this.checkInDate); + } + if (isSetNumberOfNights) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_NIGHTS, this.numberOfNights); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Lodging given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java b/src/main/java/com/adyen/model/java/MerchantData.java similarity index 68% rename from src/main/java/com/adyen/model/transferwebhooks/MerchantData.java rename to src/main/java/com/adyen/model/java/MerchantData.java index cae5b9a6d..29aae9443 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java +++ b/src/main/java/com/adyen/model/java/MerchantData.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class MerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_NAME_LOCATION = "nameLocation"; private NameLocation nameLocation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNameLocation = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantData() {} /** @@ -51,6 +74,7 @@ public MerchantData() {} */ public MerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setAcquirerId(String acquirerId) { */ public MerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setMcc(String mcc) { */ public MerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMerchantId(String merchantId) { */ public MerchantData nameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set return this; } @@ -173,6 +203,7 @@ public NameLocation getNameLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setNameLocation(NameLocation nameLocation) { */ public MerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -206,6 +238,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantData object is equal to o. */ @@ -219,15 +272,30 @@ public boolean equals(Object o) { } MerchantData merchantData = (MerchantData) o; return Objects.equals(this.acquirerId, merchantData.acquirerId) + && Objects.equals(this.isSetAcquirerId, merchantData.isSetAcquirerId) && Objects.equals(this.mcc, merchantData.mcc) + && Objects.equals(this.isSetMcc, merchantData.isSetMcc) && Objects.equals(this.merchantId, merchantData.merchantId) + && Objects.equals(this.isSetMerchantId, merchantData.isSetMerchantId) && Objects.equals(this.nameLocation, merchantData.nameLocation) - && Objects.equals(this.postalCode, merchantData.postalCode); + && Objects.equals(this.isSetNameLocation, merchantData.isSetNameLocation) + && Objects.equals(this.postalCode, merchantData.postalCode) + && Objects.equals(this.isSetPostalCode, merchantData.isSetPostalCode); } @Override public int hashCode() { - return Objects.hash(acquirerId, mcc, merchantId, nameLocation, postalCode); + return Objects.hash( + acquirerId, + isSetAcquirerId, + mcc, + isSetMcc, + merchantId, + isSetMerchantId, + nameLocation, + isSetNameLocation, + postalCode, + isSetPostalCode); } @Override @@ -253,6 +321,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetNameLocation) { + addIfNull(nulls, JSON_PROPERTY_NAME_LOCATION, this.nameLocation); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java b/src/main/java/com/adyen/model/java/MerchantPurchaseData.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java rename to src/main/java/com/adyen/model/java/MerchantPurchaseData.java index 52c0ae910..d5a5639ab 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java +++ b/src/main/java/com/adyen/model/java/MerchantPurchaseData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +35,15 @@ public class MerchantPurchaseData { public static final String JSON_PROPERTY_AIRLINE = "airline"; private Airline airline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirline = false; + public static final String JSON_PROPERTY_LODGING = "lodging"; private List lodging; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodging = false; + /** * The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data */ @@ -80,6 +88,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantPurchaseData() {} /** @@ -90,6 +107,7 @@ public MerchantPurchaseData() {} */ public MerchantPurchaseData airline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set return this; } @@ -113,6 +131,7 @@ public Airline getAirline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setAirline(Airline airline) { */ public MerchantPurchaseData lodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set return this; } @@ -154,6 +174,7 @@ public List getLodging() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setLodging(List lodging) { */ public MerchantPurchaseData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -190,6 +212,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantPurchaseData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantPurchaseData object is equal to o. */ @@ -203,13 +246,16 @@ public boolean equals(Object o) { } MerchantPurchaseData merchantPurchaseData = (MerchantPurchaseData) o; return Objects.equals(this.airline, merchantPurchaseData.airline) + && Objects.equals(this.isSetAirline, merchantPurchaseData.isSetAirline) && Objects.equals(this.lodging, merchantPurchaseData.lodging) - && Objects.equals(this.type, merchantPurchaseData.type); + && Objects.equals(this.isSetLodging, merchantPurchaseData.isSetLodging) + && Objects.equals(this.type, merchantPurchaseData.type) + && Objects.equals(this.isSetType, merchantPurchaseData.isSetType); } @Override public int hashCode() { - return Objects.hash(airline, lodging, type); + return Objects.hash(airline, isSetAirline, lodging, isSetLodging, type, isSetType); } @Override @@ -233,6 +279,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAirline) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE, this.airline); + } + if (isSetLodging) { + addIfNull(nulls, JSON_PROPERTY_LODGING, this.lodging); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantPurchaseData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Modification.java b/src/main/java/com/adyen/model/java/Modification.java similarity index 78% rename from src/main/java/com/adyen/model/transferwebhooks/Modification.java rename to src/main/java/com/adyen/model/java/Modification.java index 398b46bdb..77529b5e8 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Modification.java +++ b/src/main/java/com/adyen/model/java/Modification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +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")), @@ -215,9 +226,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() {} /** @@ -228,6 +251,7 @@ public Modification() {} */ public Modification direction(String direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -251,6 +275,7 @@ public String getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(String direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -261,6 +286,7 @@ public void setDirection(String direction) { */ public Modification id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -284,6 +310,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -294,6 +321,7 @@ public void setId(String id) { */ public Modification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -317,6 +345,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -327,6 +356,7 @@ public void setReference(String reference) { */ public Modification status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -350,6 +380,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -360,6 +391,7 @@ public void setStatus(StatusEnum status) { */ public Modification type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -383,6 +415,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public 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. */ @@ -396,15 +449,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 @@ -430,6 +498,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/java/NOLocalAccountIdentification.java similarity index 70% rename from src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/NOLocalAccountIdentification.java index 250b05d9b..3e36588e6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/NOLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class NOLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **noLocal** */ public enum TypeEnum { NOLOCAL(String.valueOf("noLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NOLocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NOLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NOLocalAccountIdentification object is equal to o. */ @@ -151,12 +189,14 @@ public boolean equals(Object o) { } NOLocalAccountIdentification noLocalAccountIdentification = (NOLocalAccountIdentification) o; return Objects.equals(this.accountNumber, noLocalAccountIdentification.accountNumber) - && Objects.equals(this.type, noLocalAccountIdentification.type); + && Objects.equals(this.isSetAccountNumber, noLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, noLocalAccountIdentification.type) + && Objects.equals(this.isSetType, noLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, type); + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType); } @Override @@ -179,6 +219,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/NZLocalAccountIdentification.java similarity index 73% rename from src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/NZLocalAccountIdentification.java index 14798f3aa..d7477d4b0 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/NZLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class NZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **nzLocal** */ public enum TypeEnum { NZLOCAL(String.valueOf("nzLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NZLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NZLocalAccountIdentification object is equal to o. */ @@ -163,12 +201,14 @@ public boolean equals(Object o) { } NZLocalAccountIdentification nzLocalAccountIdentification = (NZLocalAccountIdentification) o; return Objects.equals(this.accountNumber, nzLocalAccountIdentification.accountNumber) - && Objects.equals(this.type, nzLocalAccountIdentification.type); + && Objects.equals(this.isSetAccountNumber, nzLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, nzLocalAccountIdentification.type) + && Objects.equals(this.isSetType, nzLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, type); + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType); } @Override @@ -191,6 +231,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java b/src/main/java/com/adyen/model/java/NameLocation.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/NameLocation.java rename to src/main/java/com/adyen/model/java/NameLocation.java index dcd9872ea..cc6a354c6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java +++ b/src/main/java/com/adyen/model/java/NameLocation.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class NameLocation { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_COUNTRY_OF_ORIGIN = "countryOfOrigin"; private String countryOfOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfOrigin = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_RAW_DATA = "rawData"; private String rawData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRawData = false; + public static final String JSON_PROPERTY_STATE = "state"; private String state; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetState = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NameLocation() {} /** @@ -55,6 +81,7 @@ public NameLocation() {} */ public NameLocation city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -90,6 +118,7 @@ public void setCity(String city) { */ public NameLocation country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -131,6 +161,7 @@ public void setCountry(String country) { */ public NameLocation countryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getCountryOfOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set } /** @@ -172,6 +204,7 @@ public void setCountryOfOrigin(String countryOfOrigin) { */ public NameLocation name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -205,6 +239,7 @@ public void setName(String name) { */ public NameLocation rawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set return this; } @@ -228,6 +263,7 @@ public String getRawData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set } /** @@ -238,6 +274,7 @@ public void setRawData(String rawData) { */ public NameLocation state(String state) { this.state = state; + isSetState = true; // mark as set return this; } @@ -261,6 +298,27 @@ public String getState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setState(String state) { this.state = state; + isSetState = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NameLocation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NameLocation object is equal to o. */ @@ -274,16 +332,34 @@ public boolean equals(Object o) { } NameLocation nameLocation = (NameLocation) o; return Objects.equals(this.city, nameLocation.city) + && Objects.equals(this.isSetCity, nameLocation.isSetCity) && Objects.equals(this.country, nameLocation.country) + && Objects.equals(this.isSetCountry, nameLocation.isSetCountry) && Objects.equals(this.countryOfOrigin, nameLocation.countryOfOrigin) + && Objects.equals(this.isSetCountryOfOrigin, nameLocation.isSetCountryOfOrigin) && Objects.equals(this.name, nameLocation.name) + && Objects.equals(this.isSetName, nameLocation.isSetName) && Objects.equals(this.rawData, nameLocation.rawData) - && Objects.equals(this.state, nameLocation.state); + && Objects.equals(this.isSetRawData, nameLocation.isSetRawData) + && Objects.equals(this.state, nameLocation.state) + && Objects.equals(this.isSetState, nameLocation.isSetState); } @Override public int hashCode() { - return Objects.hash(city, country, countryOfOrigin, name, rawData, state); + return Objects.hash( + city, + isSetCity, + country, + isSetCountry, + countryOfOrigin, + isSetCountryOfOrigin, + name, + isSetName, + rawData, + isSetRawData, + state, + isSetState); } @Override @@ -310,6 +386,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetCountryOfOrigin) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_ORIGIN, this.countryOfOrigin); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetRawData) { + addIfNull(nulls, JSON_PROPERTY_RAW_DATA, this.rawData); + } + if (isSetState) { + addIfNull(nulls, JSON_PROPERTY_STATE, this.state); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NameLocation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/java/NumberAndBicAccountIdentification.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java rename to src/main/java/com/adyen/model/java/NumberAndBicAccountIdentification.java index 49ad71cb7..dcba0397f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/NumberAndBicAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,13 +34,22 @@ public class NumberAndBicAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; private AdditionalBankIdentification additionalBankIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **numberAndBic** */ public enum TypeEnum { NUMBERANDBIC(String.valueOf("numberAndBic")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NumberAndBicAccountIdentification() {} /** @@ -94,6 +114,7 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +142,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -133,6 +155,7 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -157,6 +180,7 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set } /** @@ -168,6 +192,7 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -191,6 +216,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NumberAndBicAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NumberAndBicAccountIdentification object is equal to o. */ @@ -239,16 +287,31 @@ public boolean equals(Object o) { NumberAndBicAccountIdentification numberAndBicAccountIdentification = (NumberAndBicAccountIdentification) o; return Objects.equals(this.accountNumber, numberAndBicAccountIdentification.accountNumber) + && Objects.equals( + this.isSetAccountNumber, numberAndBicAccountIdentification.isSetAccountNumber) && Objects.equals( this.additionalBankIdentification, numberAndBicAccountIdentification.additionalBankIdentification) + && Objects.equals( + this.isSetAdditionalBankIdentification, + numberAndBicAccountIdentification.isSetAdditionalBankIdentification) && Objects.equals(this.bic, numberAndBicAccountIdentification.bic) - && Objects.equals(this.type, numberAndBicAccountIdentification.type); + && Objects.equals(this.isSetBic, numberAndBicAccountIdentification.isSetBic) + && Objects.equals(this.type, numberAndBicAccountIdentification.type) + && Objects.equals(this.isSetType, numberAndBicAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, additionalBankIdentification, bic, type); + return Objects.hash( + accountNumber, + isSetAccountNumber, + additionalBankIdentification, + isSetAdditionalBankIdentification, + bic, + isSetBic, + type, + isSetType); } @Override @@ -275,6 +338,40 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/PLLocalAccountIdentification.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/PLLocalAccountIdentification.java index 5cc7835eb..d1dfd7941 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/PLLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class PLLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **plLocal** */ public enum TypeEnum { PLLOCAL(String.valueOf("plLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PLLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PLLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PLLocalAccountIdentification object is equal to o. */ @@ -163,12 +201,14 @@ public boolean equals(Object o) { } PLLocalAccountIdentification plLocalAccountIdentification = (PLLocalAccountIdentification) o; return Objects.equals(this.accountNumber, plLocalAccountIdentification.accountNumber) - && Objects.equals(this.type, plLocalAccountIdentification.type); + && Objects.equals(this.isSetAccountNumber, plLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, plLocalAccountIdentification.type) + && Objects.equals(this.isSetType, plLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, type); + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType); } @Override @@ -191,6 +231,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java b/src/main/java/com/adyen/model/java/PartyIdentification.java similarity index 80% rename from src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java rename to src/main/java/com/adyen/model/java/PartyIdentification.java index f4f324c6d..a5ffc27fa 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java +++ b/src/main/java/com/adyen/model/java/PartyIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,24 +40,45 @@ public class PartyIdentification { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The type of entity that owns the bank account or card. Possible values: **individual**, * **organization**, or **unknown**. Required when `category` is **card**. In this case, @@ -106,9 +129,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PartyIdentification() {} /** @@ -119,6 +154,7 @@ public PartyIdentification() {} */ public PartyIdentification address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -142,6 +178,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -155,6 +192,7 @@ public void setAddress(Address address) { */ public PartyIdentification dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -184,6 +222,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -195,6 +234,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PartyIdentification email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -220,6 +260,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -234,6 +275,7 @@ public void setEmail(String email) { */ public PartyIdentification firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -265,6 +307,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -279,6 +322,7 @@ public void setFirstName(String firstName) { */ public PartyIdentification fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -310,6 +354,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -324,6 +369,7 @@ public void setFullName(String fullName) { */ public PartyIdentification lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -355,6 +401,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -369,6 +416,7 @@ public void setLastName(String lastName) { */ public PartyIdentification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -400,6 +448,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -414,6 +463,7 @@ public void setReference(String reference) { */ public PartyIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -445,6 +495,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -455,6 +506,7 @@ public void setType(TypeEnum type) { */ public PartyIdentification url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -478,6 +530,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PartyIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PartyIdentification object is equal to o. */ @@ -491,20 +564,46 @@ public boolean equals(Object o) { } PartyIdentification partyIdentification = (PartyIdentification) o; return Objects.equals(this.address, partyIdentification.address) + && Objects.equals(this.isSetAddress, partyIdentification.isSetAddress) && Objects.equals(this.dateOfBirth, partyIdentification.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, partyIdentification.isSetDateOfBirth) && Objects.equals(this.email, partyIdentification.email) + && Objects.equals(this.isSetEmail, partyIdentification.isSetEmail) && Objects.equals(this.firstName, partyIdentification.firstName) + && Objects.equals(this.isSetFirstName, partyIdentification.isSetFirstName) && Objects.equals(this.fullName, partyIdentification.fullName) + && Objects.equals(this.isSetFullName, partyIdentification.isSetFullName) && Objects.equals(this.lastName, partyIdentification.lastName) + && Objects.equals(this.isSetLastName, partyIdentification.isSetLastName) && Objects.equals(this.reference, partyIdentification.reference) + && Objects.equals(this.isSetReference, partyIdentification.isSetReference) && Objects.equals(this.type, partyIdentification.type) - && Objects.equals(this.url, partyIdentification.url); + && Objects.equals(this.isSetType, partyIdentification.isSetType) + && Objects.equals(this.url, partyIdentification.url) + && Objects.equals(this.isSetUrl, partyIdentification.isSetUrl); } @Override public int hashCode() { return Objects.hash( - address, dateOfBirth, email, firstName, fullName, lastName, reference, type, url); + address, + isSetAddress, + dateOfBirth, + isSetDateOfBirth, + email, + isSetEmail, + firstName, + isSetFirstName, + fullName, + isSetFullName, + lastName, + isSetLastName, + reference, + isSetReference, + type, + isSetType, + url, + isSetUrl); } @Override @@ -534,6 +633,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PartyIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/java/PaymentInstrument.java similarity index 68% rename from src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java rename to src/main/java/com/adyen/model/java/PaymentInstrument.java index 0a21fdd52..f9fcdec61 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/java/PaymentInstrument.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class PaymentInstrument { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TOKEN_TYPE = "tokenType"; private String tokenType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrument() {} /** @@ -47,6 +67,7 @@ public PaymentInstrument() {} */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setId(String id) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setReference(String reference) { */ public PaymentInstrument tokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getTokenType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrument includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrument object is equal to o. */ @@ -182,14 +230,26 @@ public boolean equals(Object o) { } PaymentInstrument paymentInstrument = (PaymentInstrument) o; return Objects.equals(this.description, paymentInstrument.description) + && Objects.equals(this.isSetDescription, paymentInstrument.isSetDescription) && Objects.equals(this.id, paymentInstrument.id) + && Objects.equals(this.isSetId, paymentInstrument.isSetId) && Objects.equals(this.reference, paymentInstrument.reference) - && Objects.equals(this.tokenType, paymentInstrument.tokenType); + && Objects.equals(this.isSetReference, paymentInstrument.isSetReference) + && Objects.equals(this.tokenType, paymentInstrument.tokenType) + && Objects.equals(this.isSetTokenType, paymentInstrument.isSetTokenType); } @Override public int hashCode() { - return Objects.hash(description, id, reference, tokenType); + return Objects.hash( + description, + isSetDescription, + id, + isSetId, + reference, + isSetReference, + tokenType, + isSetTokenType); } @Override @@ -214,6 +274,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTokenType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_TYPE, this.tokenType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java b/src/main/java/com/adyen/model/java/PlatformPayment.java similarity index 85% rename from src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java rename to src/main/java/com/adyen/model/java/PlatformPayment.java index 89ec8e856..dd1d056a7 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java +++ b/src/main/java/com/adyen/model/java/PlatformPayment.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,12 +37,21 @@ public class 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 @@ -139,9 +150,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")); @@ -184,6 +201,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = 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() {} /** @@ -195,6 +221,7 @@ public PlatformPayment() {} */ public PlatformPayment modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -220,6 +247,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -230,6 +258,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public PlatformPayment modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -253,6 +282,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -263,6 +293,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public PlatformPayment paymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set return this; } @@ -286,6 +317,7 @@ public String getPaymentMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set } /** @@ -338,6 +370,7 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { */ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set return this; } @@ -445,6 +478,7 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set } /** @@ -455,6 +489,7 @@ public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) */ public PlatformPayment pspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set return this; } @@ -478,6 +513,7 @@ public String getPspPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set } /** @@ -488,6 +524,7 @@ public void setPspPaymentReference(String pspPaymentReference) { */ public PlatformPayment type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -511,6 +548,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum 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. */ @@ -525,22 +583,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 @@ -577,6 +651,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/java/RelayedAuthorisationData.java similarity index 70% rename from src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java rename to src/main/java/com/adyen/model/java/RelayedAuthorisationData.java index ddc54408d..a59a8bcb9 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java +++ b/src/main/java/com/adyen/model/java/RelayedAuthorisationData.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class RelayedAuthorisationData { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RelayedAuthorisationData() {} /** @@ -43,6 +57,7 @@ public RelayedAuthorisationData() {} */ public RelayedAuthorisationData metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -78,6 +93,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -88,6 +104,7 @@ public void setMetadata(Map metadata) { */ public RelayedAuthorisationData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -111,6 +128,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RelayedAuthorisationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RelayedAuthorisationData object is equal to o. */ @@ -124,12 +162,14 @@ public boolean equals(Object o) { } RelayedAuthorisationData relayedAuthorisationData = (RelayedAuthorisationData) o; return Objects.equals(this.metadata, relayedAuthorisationData.metadata) - && Objects.equals(this.reference, relayedAuthorisationData.reference); + && Objects.equals(this.isSetMetadata, relayedAuthorisationData.isSetMetadata) + && Objects.equals(this.reference, relayedAuthorisationData.reference) + && Objects.equals(this.isSetReference, relayedAuthorisationData.isSetReference); } @Override public int hashCode() { - return Objects.hash(metadata, reference); + return Objects.hash(metadata, isSetMetadata, reference, isSetReference); } @Override @@ -152,6 +192,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RelayedAuthorisationData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Resource.java b/src/main/java/com/adyen/model/java/Resource.java similarity index 68% rename from src/main/java/com/adyen/model/transferwebhooks/Resource.java rename to src/main/java/com/adyen/model/java/Resource.java index 960a64abd..04f24a2c9 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Resource.java +++ b/src/main/java/com/adyen/model/java/Resource.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +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. */ @@ -152,13 +195,17 @@ public boolean equals(Object o) { } Resource resource = (Resource) o; return Objects.equals(this.balancePlatform, resource.balancePlatform) + && Objects.equals(this.isSetBalancePlatform, resource.isSetBalancePlatform) && Objects.equals(this.creationDate, resource.creationDate) - && Objects.equals(this.id, resource.id); + && Objects.equals(this.isSetCreationDate, resource.isSetCreationDate) + && Objects.equals(this.id, resource.id) + && Objects.equals(this.isSetId, resource.isSetId); } @Override public int hashCode() { - return Objects.hash(balancePlatform, creationDate, id); + return Objects.hash( + balancePlatform, isSetBalancePlatform, creationDate, isSetCreationDate, id, isSetId); } @Override @@ -182,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 (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/java/ResourceReference.java similarity index 67% rename from src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java rename to src/main/java/com/adyen/model/java/ResourceReference.java index b3fe1de89..04f9c45f5 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/java/ResourceReference.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } ResourceReference resourceReference = (ResourceReference) o; return Objects.equals(this.description, resourceReference.description) + && Objects.equals(this.isSetDescription, resourceReference.isSetDescription) && Objects.equals(this.id, resourceReference.id) - && Objects.equals(this.reference, resourceReference.reference); + && Objects.equals(this.isSetId, resourceReference.isSetId) + && Objects.equals(this.reference, resourceReference.reference) + && Objects.equals(this.isSetReference, resourceReference.isSetReference); } @Override public int hashCode() { - return Objects.hash(description, id, reference); + return Objects.hash(description, isSetDescription, id, isSetId, reference, isSetReference); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/java/SELocalAccountIdentification.java similarity index 74% rename from src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/SELocalAccountIdentification.java index cbebe8b71..12977a6ce 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/SELocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class SELocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; private String clearingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + /** **seLocal** */ public enum TypeEnum { SELOCAL(String.valueOf("seLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SELocalAccountIdentification() {} /** @@ -90,6 +107,7 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -135,6 +154,7 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SELocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SELocalAccountIdentification object is equal to o. */ @@ -212,13 +255,18 @@ public boolean equals(Object o) { } SELocalAccountIdentification seLocalAccountIdentification = (SELocalAccountIdentification) o; return Objects.equals(this.accountNumber, seLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, seLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.clearingNumber, seLocalAccountIdentification.clearingNumber) - && Objects.equals(this.type, seLocalAccountIdentification.type); + && Objects.equals( + this.isSetClearingNumber, seLocalAccountIdentification.isSetClearingNumber) + && Objects.equals(this.type, seLocalAccountIdentification.type) + && Objects.equals(this.isSetType, seLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, clearingNumber, type); + return Objects.hash( + accountNumber, isSetAccountNumber, clearingNumber, isSetClearingNumber, type, isSetType); } @Override @@ -242,6 +290,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/SGLocalAccountIdentification.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/SGLocalAccountIdentification.java index 1d088d87f..33dde3d63 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/SGLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class SGLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **sgLocal** */ public enum TypeEnum { SGLOCAL(String.valueOf("sgLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SGLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -142,6 +162,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -152,6 +173,7 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +197,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SGLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SGLocalAccountIdentification object is equal to o. */ @@ -188,13 +231,16 @@ public boolean equals(Object o) { } SGLocalAccountIdentification sgLocalAccountIdentification = (SGLocalAccountIdentification) o; return Objects.equals(this.accountNumber, sgLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, sgLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bic, sgLocalAccountIdentification.bic) - && Objects.equals(this.type, sgLocalAccountIdentification.type); + && Objects.equals(this.isSetBic, sgLocalAccountIdentification.isSetBic) + && Objects.equals(this.type, sgLocalAccountIdentification.type) + && Objects.equals(this.isSetType, sgLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bic, type); + return Objects.hash(accountNumber, isSetAccountNumber, bic, isSetBic, type, isSetType); } @Override @@ -218,6 +264,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java b/src/main/java/com/adyen/model/java/ThreeDSecure.java similarity index 63% rename from src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java rename to src/main/java/com/adyen/model/java/ThreeDSecure.java index bda7e6d8f..c6125d71c 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java +++ b/src/main/java/com/adyen/model/java/ThreeDSecure.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class ThreeDSecure { public static final String JSON_PROPERTY_ACS_TRANSACTION_ID = "acsTransactionId"; private String acsTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransactionId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSecure() {} /** @@ -33,6 +44,7 @@ public ThreeDSecure() {} */ public ThreeDSecure acsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getAcsTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSecure includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDSecure object is equal to o. */ @@ -68,12 +101,13 @@ public boolean equals(Object o) { return false; } ThreeDSecure threeDSecure = (ThreeDSecure) o; - return Objects.equals(this.acsTransactionId, threeDSecure.acsTransactionId); + return Objects.equals(this.acsTransactionId, threeDSecure.acsTransactionId) + && Objects.equals(this.isSetAcsTransactionId, threeDSecure.isSetAcsTransactionId); } @Override public int hashCode() { - return Objects.hash(acsTransactionId); + return Objects.hash(acsTransactionId, isSetAcsTransactionId); } @Override @@ -95,6 +129,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcsTransactionId) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANSACTION_ID, this.acsTransactionId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java b/src/main/java/com/adyen/model/java/TransactionEventViolation.java similarity index 67% rename from src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java rename to src/main/java/com/adyen/model/java/TransactionEventViolation.java index bf42d1869..3fa0b295b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java +++ b/src/main/java/com/adyen/model/java/TransactionEventViolation.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class TransactionEventViolation { public static final String JSON_PROPERTY_REASON = "reason"; private String reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; private TransactionRuleReference transactionRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRule = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE_SOURCE = "transactionRuleSource"; private TransactionRuleSource transactionRuleSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRuleSource = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionEventViolation() {} /** @@ -43,6 +60,7 @@ public TransactionEventViolation() {} */ public TransactionEventViolation reason(String reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setReason(String reason) { */ public TransactionEventViolation transactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set return this; } @@ -99,6 +119,7 @@ public TransactionRuleReference getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setTransactionRule(TransactionRuleReference transactionRule) { public TransactionEventViolation transactionRuleSource( TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set return this; } @@ -133,6 +155,27 @@ public TransactionRuleSource getTransactionRuleSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRuleSource(TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionEventViolation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionEventViolation object is equal to o. */ @@ -146,14 +189,24 @@ public boolean equals(Object o) { } TransactionEventViolation transactionEventViolation = (TransactionEventViolation) o; return Objects.equals(this.reason, transactionEventViolation.reason) + && Objects.equals(this.isSetReason, transactionEventViolation.isSetReason) && Objects.equals(this.transactionRule, transactionEventViolation.transactionRule) + && Objects.equals(this.isSetTransactionRule, transactionEventViolation.isSetTransactionRule) && Objects.equals( - this.transactionRuleSource, transactionEventViolation.transactionRuleSource); + this.transactionRuleSource, transactionEventViolation.transactionRuleSource) + && Objects.equals( + this.isSetTransactionRuleSource, transactionEventViolation.isSetTransactionRuleSource); } @Override public int hashCode() { - return Objects.hash(reason, transactionRule, transactionRuleSource); + return Objects.hash( + reason, + isSetReason, + transactionRule, + isSetTransactionRule, + transactionRuleSource, + isSetTransactionRuleSource); } @Override @@ -179,6 +232,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetTransactionRule) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); + } + if (isSetTransactionRuleSource) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE_SOURCE, this.transactionRuleSource); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionEventViolation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java b/src/main/java/com/adyen/model/java/TransactionRuleReference.java similarity index 70% rename from src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java rename to src/main/java/com/adyen/model/java/TransactionRuleReference.java index 73caf743b..b380746ae 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java +++ b/src/main/java/com/adyen/model/java/TransactionRuleReference.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class TransactionRuleReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private String outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleReference() {} /** @@ -51,6 +74,7 @@ public TransactionRuleReference() {} */ public TransactionRuleReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setDescription(String description) { */ public TransactionRuleReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setId(String id) { */ public TransactionRuleReference outcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setOutcomeType(String outcomeType) { */ public TransactionRuleReference reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -185,6 +216,7 @@ public void setReference(String reference) { */ public TransactionRuleReference score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -212,6 +244,27 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleReference object is equal to o. */ @@ -225,15 +278,30 @@ public boolean equals(Object o) { } TransactionRuleReference transactionRuleReference = (TransactionRuleReference) o; return Objects.equals(this.description, transactionRuleReference.description) + && Objects.equals(this.isSetDescription, transactionRuleReference.isSetDescription) && Objects.equals(this.id, transactionRuleReference.id) + && Objects.equals(this.isSetId, transactionRuleReference.isSetId) && Objects.equals(this.outcomeType, transactionRuleReference.outcomeType) + && Objects.equals(this.isSetOutcomeType, transactionRuleReference.isSetOutcomeType) && Objects.equals(this.reference, transactionRuleReference.reference) - && Objects.equals(this.score, transactionRuleReference.score); + && Objects.equals(this.isSetReference, transactionRuleReference.isSetReference) + && Objects.equals(this.score, transactionRuleReference.score) + && Objects.equals(this.isSetScore, transactionRuleReference.isSetScore); } @Override public int hashCode() { - return Objects.hash(description, id, outcomeType, reference, score); + return Objects.hash( + description, + isSetDescription, + id, + isSetId, + outcomeType, + isSetOutcomeType, + reference, + isSetReference, + score, + isSetScore); } @Override @@ -259,6 +327,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java b/src/main/java/com/adyen/model/java/TransactionRuleSource.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java rename to src/main/java/com/adyen/model/java/TransactionRuleSource.java index 73cab0fca..c41e954ab 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java +++ b/src/main/java/com/adyen/model/java/TransactionRuleSource.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TransactionRuleSource { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleSource() {} /** @@ -39,6 +53,7 @@ public TransactionRuleSource() {} */ public TransactionRuleSource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setId(String id) { */ public TransactionRuleSource type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleSource includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleSource object is equal to o. */ @@ -126,12 +164,14 @@ public boolean equals(Object o) { } TransactionRuleSource transactionRuleSource = (TransactionRuleSource) o; return Objects.equals(this.id, transactionRuleSource.id) - && Objects.equals(this.type, transactionRuleSource.type); + && Objects.equals(this.isSetId, transactionRuleSource.isSetId) + && Objects.equals(this.type, transactionRuleSource.type) + && Objects.equals(this.isSetType, transactionRuleSource.isSetType); } @Override public int hashCode() { - return Objects.hash(id, type); + return Objects.hash(id, isSetId, type, isSetType); } @Override @@ -154,6 +194,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleSource given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java b/src/main/java/com/adyen/model/java/TransactionRulesResult.java similarity index 71% rename from src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java rename to src/main/java/com/adyen/model/java/TransactionRulesResult.java index 8a6be6073..ccd773533 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java +++ b/src/main/java/com/adyen/model/java/TransactionRulesResult.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,16 +32,34 @@ public class TransactionRulesResult { public static final String JSON_PROPERTY_ADVICE = "advice"; private String advice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdvice = false; + public static final String JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED = "allHardBlockRulesPassed"; private Boolean allHardBlockRulesPassed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllHardBlockRulesPassed = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES = "triggeredTransactionRules"; private List triggeredTransactionRules; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggeredTransactionRules = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRulesResult() {} /** @@ -50,6 +70,7 @@ public TransactionRulesResult() {} */ public TransactionRulesResult advice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set return this; } @@ -73,6 +94,7 @@ public String getAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdvice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAdvice(String advice) { */ public TransactionRulesResult allHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Boolean getAllHardBlockRulesPassed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { */ public TransactionRulesResult score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -154,6 +180,7 @@ public void setScore(Integer score) { public TransactionRulesResult triggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set return this; } @@ -189,6 +216,27 @@ public List getTriggeredTransactionRules() { public void setTriggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRulesResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRulesResult object is equal to o. */ @@ -202,16 +250,31 @@ public boolean equals(Object o) { } TransactionRulesResult transactionRulesResult = (TransactionRulesResult) o; return Objects.equals(this.advice, transactionRulesResult.advice) + && Objects.equals(this.isSetAdvice, transactionRulesResult.isSetAdvice) && Objects.equals( this.allHardBlockRulesPassed, transactionRulesResult.allHardBlockRulesPassed) + && Objects.equals( + this.isSetAllHardBlockRulesPassed, transactionRulesResult.isSetAllHardBlockRulesPassed) && Objects.equals(this.score, transactionRulesResult.score) + && Objects.equals(this.isSetScore, transactionRulesResult.isSetScore) && Objects.equals( - this.triggeredTransactionRules, transactionRulesResult.triggeredTransactionRules); + this.triggeredTransactionRules, transactionRulesResult.triggeredTransactionRules) + && Objects.equals( + this.isSetTriggeredTransactionRules, + transactionRulesResult.isSetTriggeredTransactionRules); } @Override public int hashCode() { - return Objects.hash(advice, allHardBlockRulesPassed, score, triggeredTransactionRules); + return Objects.hash( + advice, + isSetAdvice, + allHardBlockRulesPassed, + isSetAllHardBlockRulesPassed, + score, + isSetScore, + triggeredTransactionRules, + isSetTriggeredTransactionRules); } @Override @@ -240,6 +303,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdvice) { + addIfNull(nulls, JSON_PROPERTY_ADVICE, this.advice); + } + if (isSetAllHardBlockRulesPassed) { + addIfNull(nulls, JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED, this.allHardBlockRulesPassed); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetTriggeredTransactionRules) { + addIfNull(nulls, JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES, this.triggeredTransactionRules); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRulesResult given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java b/src/main/java/com/adyen/model/java/TransferData.java similarity index 84% rename from src/main/java/com/adyen/model/transferwebhooks/TransferData.java rename to src/main/java/com/adyen/model/java/TransferData.java index 8734606a0..5dd0f7d47 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java +++ b/src/main/java/com/adyen/model/java/TransferData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +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,18 +62,33 @@ 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) @@ -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")), @@ -425,18 +484,33 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_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 @@ -621,12 +695,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**. @@ -746,9 +829,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() {} /** @@ -759,6 +854,7 @@ public TransferData() {} */ public TransferData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -782,6 +878,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -792,6 +889,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public TransferData amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -815,6 +913,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -825,6 +924,7 @@ public void setAmount(Amount amount) { */ public TransferData balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -848,6 +948,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -858,6 +959,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public TransferData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -881,6 +983,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -891,6 +994,7 @@ public void setBalancePlatform(String balancePlatform) { */ public TransferData balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -922,6 +1026,7 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -947,6 +1052,7 @@ public void setBalances(List balances) { */ public TransferData category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -1000,6 +1106,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -1010,6 +1117,7 @@ public void setCategory(CategoryEnum category) { */ public TransferData categoryData(TransferDataCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -1033,6 +1141,7 @@ public TransferDataCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferDataCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -1043,6 +1152,7 @@ public void setCategoryData(TransferDataCategoryData categoryData) { */ public TransferData counterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -1066,6 +1176,7 @@ public TransferNotificationCounterParty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -1078,6 +1189,7 @@ public void setCounterparty(TransferNotificationCounterParty counterparty) { */ public TransferData createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -1105,6 +1217,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -1119,6 +1232,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; } @@ -1150,6 +1264,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -1168,6 +1283,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public TransferData description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -1207,6 +1323,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -1217,6 +1334,7 @@ public void setDescription(String description) { */ public TransferData directDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set return this; } @@ -1240,6 +1358,7 @@ public DirectDebitInformation getDirectDebitInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set } /** @@ -1250,6 +1369,7 @@ public void setDirectDebitInformation(DirectDebitInformation directDebitInformat */ public TransferData direction(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -1273,6 +1393,7 @@ public DirectionEnum getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -1285,6 +1406,7 @@ public void setDirection(DirectionEnum direction) { */ public TransferData eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -1312,6 +1434,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -1322,6 +1445,7 @@ public void setEventId(String eventId) { */ public TransferData events(List events) { this.events = events; + isSetEvents = true; // mark as set return this; } @@ -1353,6 +1477,7 @@ public List getEvents() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEvents(List events) { this.events = events; + isSetEvents = true; // mark as set } /** @@ -1363,6 +1488,7 @@ public void setEvents(List events) { */ public TransferData executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -1386,6 +1512,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -1396,6 +1523,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public TransferData externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -1419,6 +1547,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -1429,6 +1558,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -1452,6 +1582,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -1462,6 +1593,7 @@ public void setId(String id) { */ public TransferData paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -1485,6 +1617,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -1495,6 +1628,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public TransferData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -1518,6 +1652,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -1530,6 +1665,7 @@ public void setReason(ReasonEnum reason) { */ public TransferData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1557,6 +1693,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1575,6 +1712,7 @@ public void setReference(String reference) { */ public TransferData referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -1614,6 +1752,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -1624,6 +1763,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public TransferData review(TransferReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1647,6 +1787,7 @@ public TransferReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferReview review) { this.review = review; + isSetReview = true; // mark as set } /** @@ -1661,6 +1802,7 @@ public void setReview(TransferReview review) { */ public TransferData sequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set return this; } @@ -1692,6 +1834,7 @@ public Integer getSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set } /** @@ -1715,6 +1858,7 @@ public void setSequenceNumber(Integer sequenceNumber) { */ public TransferData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -1764,6 +1908,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -1774,6 +1919,7 @@ public void setStatus(StatusEnum status) { */ public TransferData tracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set return this; } @@ -1797,6 +1943,7 @@ public TransferDataTracking getTracking() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set } /** @@ -1807,6 +1954,7 @@ public void setTracking(TransferDataTracking tracking) { */ public TransferData transactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set return this; } @@ -1830,6 +1978,7 @@ public TransactionRulesResult getTransactionRulesResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set } /** @@ -1842,6 +1991,7 @@ public void setTransactionRulesResult(TransactionRulesResult transactionRulesRes */ public TransferData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1869,6 +2019,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1881,6 +2032,7 @@ public void setType(TypeEnum type) { */ public TransferData updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set return this; } @@ -1908,6 +2060,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. */ @@ -1921,68 +2094,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 @@ -2038,6 +2272,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/TransferDataCategoryData.java b/src/main/java/com/adyen/model/java/TransferDataCategoryData.java similarity index 99% rename from src/main/java/com/adyen/model/transferwebhooks/TransferDataCategoryData.java rename to src/main/java/com/adyen/model/java/TransferDataCategoryData.java index e8dc4fa80..af8573138 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferDataCategoryData.java +++ b/src/main/java/com/adyen/model/java/TransferDataCategoryData.java @@ -9,7 +9,7 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferDataTracking.java b/src/main/java/com/adyen/model/java/TransferDataTracking.java similarity index 99% rename from src/main/java/com/adyen/model/transferwebhooks/TransferDataTracking.java rename to src/main/java/com/adyen/model/java/TransferDataTracking.java index 452eb8c73..4e8912def 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferDataTracking.java +++ b/src/main/java/com/adyen/model/java/TransferDataTracking.java @@ -9,7 +9,7 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java b/src/main/java/com/adyen/model/java/TransferEvent.java similarity index 82% rename from src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java rename to src/main/java/com/adyen/model/java/TransferEvent.java index 2420ee509..5a9ba7e86 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java +++ b/src/main/java/com/adyen/model/java/TransferEvent.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +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")), @@ -290,6 +325,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")), @@ -466,12 +504,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")), @@ -518,12 +565,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() {} /** @@ -534,6 +596,7 @@ public TransferEvent() {} */ public TransferEvent amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -557,6 +620,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -569,6 +633,7 @@ public void setAmount(Amount amount) { */ public TransferEvent amountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set return this; } @@ -604,6 +669,7 @@ public List getAmountAdjustments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set } /** @@ -614,6 +680,7 @@ public void setAmountAdjustments(List amountAdjustments) { */ public TransferEvent arn(String arn) { this.arn = arn; + isSetArn = true; // mark as set return this; } @@ -638,6 +705,7 @@ public String getArn() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArn(String arn) { this.arn = arn; + isSetArn = true; // mark as set } /** @@ -648,6 +716,7 @@ public void setArn(String arn) { */ public TransferEvent bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set return this; } @@ -671,6 +740,7 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set } /** @@ -682,6 +752,7 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public TransferEvent estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -707,6 +778,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -717,6 +789,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public TransferEvent eventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set return this; } @@ -748,6 +821,7 @@ public List getEventsData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set } /** @@ -758,6 +832,7 @@ public void setEventsData(List eventsData) { */ public TransferEvent externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -781,6 +856,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -791,6 +867,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferEvent id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -814,6 +891,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -824,6 +902,7 @@ public void setId(String id) { */ public TransferEvent modification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set return this; } @@ -847,6 +926,7 @@ public Modification getModification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set } /** @@ -857,6 +937,7 @@ public void setModification(Modification modification) { */ public TransferEvent mutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set return this; } @@ -888,6 +969,7 @@ public List getMutations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set } /** @@ -898,6 +980,7 @@ public void setMutations(List mutations) { */ public TransferEvent originalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set return this; } @@ -921,6 +1004,7 @@ public Amount getOriginalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set } /** @@ -931,6 +1015,7 @@ public void setOriginalAmount(Amount originalAmount) { */ public TransferEvent reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -954,6 +1039,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -964,6 +1050,7 @@ public void setReason(ReasonEnum reason) { */ public TransferEvent status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -987,6 +1074,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -997,6 +1085,7 @@ public void setStatus(StatusEnum status) { */ public TransferEvent trackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set return this; } @@ -1020,6 +1109,7 @@ public TransferEventTrackingData getTrackingData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set } /** @@ -1032,6 +1122,7 @@ public void setTrackingData(TransferEventTrackingData trackingData) { */ public TransferEvent transactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set return this; } @@ -1059,6 +1150,7 @@ public String getTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set } /** @@ -1069,6 +1161,7 @@ public void setTransactionId(String transactionId) { */ public TransferEvent type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1092,6 +1185,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1102,6 +1196,7 @@ public void setType(TypeEnum type) { */ public TransferEvent updateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set return this; } @@ -1125,6 +1220,7 @@ public OffsetDateTime getUpdateDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set } /** @@ -1137,6 +1233,7 @@ public void setUpdateDate(OffsetDateTime updateDate) { */ public TransferEvent valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set return this; } @@ -1164,6 +1261,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. */ @@ -1177,46 +1295,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 @@ -1257,6 +1411,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/TransferEventEventsDataInner.java b/src/main/java/com/adyen/model/java/TransferEventEventsDataInner.java similarity index 99% rename from src/main/java/com/adyen/model/transferwebhooks/TransferEventEventsDataInner.java rename to src/main/java/com/adyen/model/java/TransferEventEventsDataInner.java index 6cd56c7a4..7249fa56e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferEventEventsDataInner.java +++ b/src/main/java/com/adyen/model/java/TransferEventEventsDataInner.java @@ -9,7 +9,7 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferEventTrackingData.java b/src/main/java/com/adyen/model/java/TransferEventTrackingData.java similarity index 99% rename from src/main/java/com/adyen/model/transferwebhooks/TransferEventTrackingData.java rename to src/main/java/com/adyen/model/java/TransferEventTrackingData.java index c775beac7..e639c2628 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferEventTrackingData.java +++ b/src/main/java/com/adyen/model/java/TransferEventTrackingData.java @@ -9,7 +9,7 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java b/src/main/java/com/adyen/model/java/TransferNotificationCounterParty.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java rename to src/main/java/com/adyen/model/java/TransferNotificationCounterParty.java index cb9c7a255..ca41cba97 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java +++ b/src/main/java/com/adyen/model/java/TransferNotificationCounterParty.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class TransferNotificationCounterParty { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_MERCHANT = "merchant"; private TransferNotificationMerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationCounterParty() {} /** @@ -54,6 +77,7 @@ public TransferNotificationCounterParty() {} */ public TransferNotificationCounterParty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -92,6 +117,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public TransferNotificationCounterParty bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -115,6 +141,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -126,6 +153,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public TransferNotificationCounterParty card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -149,6 +177,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -160,6 +189,7 @@ public void setCard(Card card) { */ public TransferNotificationCounterParty merchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -183,6 +213,7 @@ public TransferNotificationMerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -196,6 +227,7 @@ public void setMerchant(TransferNotificationMerchantData merchant) { */ public TransferNotificationCounterParty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -223,6 +255,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationCounterParty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationCounterParty object is equal to o. */ @@ -237,16 +290,34 @@ public boolean equals(Object o) { TransferNotificationCounterParty transferNotificationCounterParty = (TransferNotificationCounterParty) o; return Objects.equals(this.balanceAccountId, transferNotificationCounterParty.balanceAccountId) + && Objects.equals( + this.isSetBalanceAccountId, transferNotificationCounterParty.isSetBalanceAccountId) && Objects.equals(this.bankAccount, transferNotificationCounterParty.bankAccount) + && Objects.equals(this.isSetBankAccount, transferNotificationCounterParty.isSetBankAccount) && Objects.equals(this.card, transferNotificationCounterParty.card) + && Objects.equals(this.isSetCard, transferNotificationCounterParty.isSetCard) && Objects.equals(this.merchant, transferNotificationCounterParty.merchant) + && Objects.equals(this.isSetMerchant, transferNotificationCounterParty.isSetMerchant) + && Objects.equals( + this.transferInstrumentId, transferNotificationCounterParty.transferInstrumentId) && Objects.equals( - this.transferInstrumentId, transferNotificationCounterParty.transferInstrumentId); + this.isSetTransferInstrumentId, + transferNotificationCounterParty.isSetTransferInstrumentId); } @Override public int hashCode() { - return Objects.hash(balanceAccountId, bankAccount, card, merchant, transferInstrumentId); + return Objects.hash( + balanceAccountId, + isSetBalanceAccountId, + bankAccount, + isSetBankAccount, + card, + isSetCard, + merchant, + isSetMerchant, + transferInstrumentId, + isSetTransferInstrumentId); } @Override @@ -274,6 +345,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationCounterParty given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java b/src/main/java/com/adyen/model/java/TransferNotificationMerchantData.java similarity index 71% rename from src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java rename to src/main/java/com/adyen/model/java/TransferNotificationMerchantData.java index 1595c6a5b..ed9ba3dfb 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java +++ b/src/main/java/com/adyen/model/java/TransferNotificationMerchantData.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,24 +33,51 @@ public class TransferNotificationMerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationMerchantData() {} /** @@ -60,6 +89,7 @@ public TransferNotificationMerchantData() {} */ public TransferNotificationMerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -83,6 +113,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -94,6 +125,7 @@ public void setAcquirerId(String acquirerId) { */ public TransferNotificationMerchantData city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -117,6 +149,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -128,6 +161,7 @@ public void setCity(String city) { */ public TransferNotificationMerchantData country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -151,6 +185,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -162,6 +197,7 @@ public void setCountry(String country) { */ public TransferNotificationMerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -185,6 +221,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -196,6 +233,7 @@ public void setMcc(String mcc) { */ public TransferNotificationMerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -219,6 +257,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -230,6 +269,7 @@ public void setMerchantId(String merchantId) { */ public TransferNotificationMerchantData name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -253,6 +293,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -264,6 +305,7 @@ public void setName(String name) { */ public TransferNotificationMerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -287,6 +329,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationMerchantData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationMerchantData object is equal to o. */ @@ -301,17 +364,38 @@ public boolean equals(Object o) { TransferNotificationMerchantData transferNotificationMerchantData = (TransferNotificationMerchantData) o; return Objects.equals(this.acquirerId, transferNotificationMerchantData.acquirerId) + && Objects.equals(this.isSetAcquirerId, transferNotificationMerchantData.isSetAcquirerId) && Objects.equals(this.city, transferNotificationMerchantData.city) + && Objects.equals(this.isSetCity, transferNotificationMerchantData.isSetCity) && Objects.equals(this.country, transferNotificationMerchantData.country) + && Objects.equals(this.isSetCountry, transferNotificationMerchantData.isSetCountry) && Objects.equals(this.mcc, transferNotificationMerchantData.mcc) + && Objects.equals(this.isSetMcc, transferNotificationMerchantData.isSetMcc) && Objects.equals(this.merchantId, transferNotificationMerchantData.merchantId) + && Objects.equals(this.isSetMerchantId, transferNotificationMerchantData.isSetMerchantId) && Objects.equals(this.name, transferNotificationMerchantData.name) - && Objects.equals(this.postalCode, transferNotificationMerchantData.postalCode); + && Objects.equals(this.isSetName, transferNotificationMerchantData.isSetName) + && Objects.equals(this.postalCode, transferNotificationMerchantData.postalCode) + && Objects.equals(this.isSetPostalCode, transferNotificationMerchantData.isSetPostalCode); } @Override public int hashCode() { - return Objects.hash(acquirerId, city, country, mcc, merchantId, name, postalCode); + return Objects.hash( + acquirerId, + isSetAcquirerId, + city, + isSetCity, + country, + isSetCountry, + mcc, + isSetMcc, + merchantId, + isSetMerchantId, + name, + isSetName, + postalCode, + isSetPostalCode); } @Override @@ -339,6 +423,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationMerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java b/src/main/java/com/adyen/model/java/TransferNotificationRequest.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java rename to src/main/java/com/adyen/model/java/TransferNotificationRequest.java index 3807a8fb1..65e8ebfef 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/TransferNotificationRequest.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +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. */ @@ -231,14 +279,19 @@ public boolean equals(Object o) { } TransferNotificationRequest transferNotificationRequest = (TransferNotificationRequest) o; return Objects.equals(this.data, transferNotificationRequest.data) + && Objects.equals(this.isSetData, transferNotificationRequest.isSetData) && Objects.equals(this.environment, transferNotificationRequest.environment) + && Objects.equals(this.isSetEnvironment, transferNotificationRequest.isSetEnvironment) && Objects.equals(this.timestamp, transferNotificationRequest.timestamp) - && Objects.equals(this.type, transferNotificationRequest.type); + && Objects.equals(this.isSetTimestamp, transferNotificationRequest.isSetTimestamp) + && Objects.equals(this.type, transferNotificationRequest.type) + && Objects.equals(this.isSetType, transferNotificationRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(data, environment, timestamp, type); + return Objects.hash( + data, isSetData, environment, isSetEnvironment, timestamp, isSetTimestamp, type, isSetType); } @Override @@ -263,6 +316,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/java/TransferNotificationValidationFact.java similarity index 67% rename from src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java rename to src/main/java/com/adyen/model/java/TransferNotificationValidationFact.java index efaaecffd..c3cdf3cc0 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java +++ b/src/main/java/com/adyen/model/java/TransferNotificationValidationFact.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TransferNotificationValidationFact { public static final String JSON_PROPERTY_RESULT = "result"; private String result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationValidationFact() {} /** @@ -40,6 +54,7 @@ public TransferNotificationValidationFact() {} */ public TransferNotificationValidationFact result(String result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setResult(String result) { */ public TransferNotificationValidationFact type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationValidationFact includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferNotificationValidationFact object is equal to o. */ @@ -111,12 +149,14 @@ public boolean equals(Object o) { TransferNotificationValidationFact transferNotificationValidationFact = (TransferNotificationValidationFact) o; return Objects.equals(this.result, transferNotificationValidationFact.result) - && Objects.equals(this.type, transferNotificationValidationFact.type); + && Objects.equals(this.isSetResult, transferNotificationValidationFact.isSetResult) + && Objects.equals(this.type, transferNotificationValidationFact.type) + && Objects.equals(this.isSetType, transferNotificationValidationFact.isSetType); } @Override public int hashCode() { - return Objects.hash(result, type); + return Objects.hash(result, isSetResult, type, isSetType); } @Override @@ -139,6 +179,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationValidationFact given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java b/src/main/java/com/adyen/model/java/TransferReview.java similarity index 74% rename from src/main/java/com/adyen/model/transferwebhooks/TransferReview.java rename to src/main/java/com/adyen/model/java/TransferReview.java index 6d8f4bd11..9f1429d11 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java +++ b/src/main/java/com/adyen/model/java/TransferReview.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class TransferReview { "numberOfApprovalsRequired"; private Integer numberOfApprovalsRequired; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfApprovalsRequired = false; + /** * Shows the status of the Strong Customer Authentication (SCA) process. Possible values: * **required**, **notApplicable**. @@ -80,6 +85,15 @@ public static ScaOnApprovalEnum fromValue(String value) { public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private ScaOnApprovalEnum scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferReview() {} /** @@ -94,6 +108,7 @@ public TransferReview() {} */ public TransferReview numberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set return this; } @@ -125,6 +140,7 @@ public Integer getNumberOfApprovalsRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set } /** @@ -137,6 +153,7 @@ public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { */ public TransferReview scaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -164,6 +181,27 @@ public ScaOnApprovalEnum getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferReview includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferReview object is equal to o. */ @@ -177,12 +215,19 @@ public boolean equals(Object o) { } TransferReview transferReview = (TransferReview) o; return Objects.equals(this.numberOfApprovalsRequired, transferReview.numberOfApprovalsRequired) - && Objects.equals(this.scaOnApproval, transferReview.scaOnApproval); + && Objects.equals( + this.isSetNumberOfApprovalsRequired, transferReview.isSetNumberOfApprovalsRequired) + && Objects.equals(this.scaOnApproval, transferReview.scaOnApproval) + && Objects.equals(this.isSetScaOnApproval, transferReview.isSetScaOnApproval); } @Override public int hashCode() { - return Objects.hash(numberOfApprovalsRequired, scaOnApproval); + return Objects.hash( + numberOfApprovalsRequired, + isSetNumberOfApprovalsRequired, + scaOnApproval, + isSetScaOnApproval); } @Override @@ -207,6 +252,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNumberOfApprovalsRequired) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_APPROVALS_REQUIRED, this.numberOfApprovalsRequired); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferReview given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/UKLocalAccountIdentification.java similarity index 72% rename from src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/UKLocalAccountIdentification.java index 726a08c59..e0e6847f5 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/UKLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class UKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + /** **ukLocal** */ public enum TypeEnum { UKLOCAL(String.valueOf("ukLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UKLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UKLocalAccountIdentification object is equal to o. */ @@ -194,13 +237,17 @@ public boolean equals(Object o) { } UKLocalAccountIdentification ukLocalAccountIdentification = (UKLocalAccountIdentification) o; return Objects.equals(this.accountNumber, ukLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, ukLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.sortCode, ukLocalAccountIdentification.sortCode) - && Objects.equals(this.type, ukLocalAccountIdentification.type); + && Objects.equals(this.isSetSortCode, ukLocalAccountIdentification.isSetSortCode) + && Objects.equals(this.type, ukLocalAccountIdentification.type) + && Objects.equals(this.isSetType, ukLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, sortCode, type); + return Objects.hash( + accountNumber, isSetAccountNumber, sortCode, isSetSortCode, type, isSetType); } @Override @@ -224,6 +271,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/java/USLocalAccountIdentification.java similarity index 75% rename from src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java rename to src/main/java/com/adyen/model/java/USLocalAccountIdentification.java index d11a9c0a2..f0ae70f5f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/java/USLocalAccountIdentification.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class USLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -78,9 +83,15 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + /** **usLocal** */ public enum TypeEnum { USLOCAL(String.valueOf("usLocal")); @@ -123,6 +134,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public USLocalAccountIdentification() {} /** @@ -133,6 +153,7 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -156,6 +177,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +189,7 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -192,6 +215,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -205,6 +229,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -234,6 +259,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -244,6 +270,7 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -267,6 +294,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public USLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this USLocalAccountIdentification object is equal to o. */ @@ -280,14 +328,26 @@ public boolean equals(Object o) { } USLocalAccountIdentification usLocalAccountIdentification = (USLocalAccountIdentification) o; return Objects.equals(this.accountNumber, usLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, usLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.accountType, usLocalAccountIdentification.accountType) + && Objects.equals(this.isSetAccountType, usLocalAccountIdentification.isSetAccountType) && Objects.equals(this.routingNumber, usLocalAccountIdentification.routingNumber) - && Objects.equals(this.type, usLocalAccountIdentification.type); + && Objects.equals(this.isSetRoutingNumber, usLocalAccountIdentification.isSetRoutingNumber) + && Objects.equals(this.type, usLocalAccountIdentification.type) + && Objects.equals(this.isSetType, usLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, accountType, routingNumber, type); + return Objects.hash( + accountNumber, + isSetAccountNumber, + accountType, + isSetAccountType, + routingNumber, + isSetRoutingNumber, + type, + isSetType); } @Override @@ -312,6 +372,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of USLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/JSON.java b/src/main/java/com/adyen/model/transferwebhooks/JSON.java index 96b83a20b..abe09e65a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/JSON.java +++ b/src/main/java/com/adyen/model/transferwebhooks/JSON.java @@ -1,4 +1,4 @@ -package com.adyen.model.transferwebhooks; +package com.adyen.model.java; import com.adyen.serializer.ByteArrayDeserializer; import com.adyen.serializer.ByteArraySerializer; diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferWebhooksHandler.java b/src/main/java/com/adyen/model/transferwebhooks/TransferWebhooksHandler.java deleted file mode 100644 index 0002b5b71..000000000 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferWebhooksHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Transfer webhooks - * - * 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.transferwebhooks; - -import java.util.Optional; -import java.util.logging.Logger; - -/** - * Handler for processing TransferWebhooks. - * - *

This class provides functionality to deserialize the payload of TransferWebhooks events. - */ -public class TransferWebhooksHandler { - - private static final Logger LOG = Logger.getLogger(TransferWebhooksHandler.class.getName()); - - private final String payload; - - /** - * Constructs a new handler for the given webhook payload - * - * @param payload the raw JSON payload from the webhook - */ - public TransferWebhooksHandler(String payload) { - this.payload = payload; - } - - /** - * Attempts to deserialize the webhook payload into a TransferNotificationRequest - * - * @return an Optional containing the deserialized object, or empty if deserialization fails - */ - public Optional getTransferNotificationRequest() { - - var optionalTransferNotificationRequest = getOptionalField(TransferNotificationRequest.class); - - if (optionalTransferNotificationRequest.isPresent()) { - // verify event type - for (var value : TransferNotificationRequest.TypeEnum.values()) { - if (value.equals(optionalTransferNotificationRequest.get().getType())) { - // found matching event type - return optionalTransferNotificationRequest; - } - } - } - - return Optional.empty(); - } - - /** - * Deserializes the payload into the specified class type. - * - * @param clazz the class to deserialize into - * @param the type of the class - * @return an Optional containing the deserialized object, or empty if an error occurs - */ - private Optional getOptionalField(Class clazz) { - try { - T val = JSON.getMapper().readValue(payload, clazz); - return Optional.ofNullable(val); - } catch (Exception e) { - // an error has occurred during deserialization (object not found, deserialization error) - LOG.warning("Object not found or unexpected error trying to access: " + clazz.getName()); - LOG.warning("Deserialization error: " + e.getMessage()); - return Optional.empty(); - } - } -}