diff --git a/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java index fc9b5cafd..4d4bb84eb 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class AULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; private String bsbCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + /** **auLocal** */ public enum TypeEnum { AULOCAL(String.valueOf("auLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AULocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AULocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index 7051c52ce..e8cc6e79f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -44,35 +46,65 @@ public class AccountHolder { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; @Deprecated // deprecated private ContactDetails contactDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContactDetails = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; private String migratedAccountHolderCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountHolderCode = false; + public static final String JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; private String primaryBalanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrimaryBalanceAccount = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The status of the account holder. Possible values: * **active**: The account holder is active * and allowed to use its capabilities. This is the initial status for account holders and balance @@ -126,12 +158,27 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + public static final String JSON_PROPERTY_VERIFICATION_DEADLINES = "verificationDeadlines"; private List verificationDeadlines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationDeadlines = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolder() {} @JsonCreator @@ -160,6 +207,7 @@ public AccountHolder( */ public AccountHolder balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -195,6 +243,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -210,6 +259,7 @@ public void setBalancePlatform(String balancePlatform) { */ public AccountHolder capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -251,6 +301,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -263,6 +314,7 @@ public void setCapabilities(Map capabilities) { @Deprecated // deprecated public AccountHolder contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set return this; } @@ -290,6 +342,7 @@ public ContactDetails getContactDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set } /** @@ -300,6 +353,7 @@ public void setContactDetails(ContactDetails contactDetails) { */ public AccountHolder description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -323,6 +377,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -350,6 +405,7 @@ public String getId() { */ public AccountHolder legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -385,6 +441,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -400,6 +457,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountHolder metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -441,6 +499,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -467,6 +526,7 @@ public String getMigratedAccountHolderCode() { */ public AccountHolder primaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set return this; } @@ -498,6 +558,7 @@ public String getPrimaryBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrimaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set } /** @@ -508,6 +569,7 @@ public void setPrimaryBalanceAccount(String primaryBalanceAccount) { */ public AccountHolder reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -531,6 +593,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -552,6 +615,7 @@ public void setReference(String reference) { */ public AccountHolder status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -597,6 +661,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -612,6 +677,7 @@ public void setStatus(StatusEnum status) { */ public AccountHolder timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -645,6 +711,7 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set } /** @@ -660,6 +727,26 @@ public List getVerificationDeadlines() { return verificationDeadlines; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolder includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + /** Return true if this AccountHolder object is equal to o. */ @Override public boolean equals(Object o) { @@ -740,6 +827,66 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetContactDetails) { + addIfNull(nulls, JSON_PROPERTY_CONTACT_DETAILS, this.contactDetails); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountHolderCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, this.migratedAccountHolderCode); + } + if (isSetPrimaryBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT, this.primaryBalanceAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + if (isSetVerificationDeadlines) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_DEADLINES, this.verificationDeadlines); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountHolder given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java index 4185adeb4..3806e06bf 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,6 +41,9 @@ public class AccountHolderCapability { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + /** * The capability level that is allowed for the account holder. Possible values: * **notApplicable**, **low**, **medium**, **high**. @@ -90,18 +95,33 @@ public static AllowedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private AllowedLevelEnum allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_ALLOWED_SETTINGS = "allowedSettings"; private CapabilitySettings allowedSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedSettings = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; private Boolean enabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = false; + public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + /** * The requested level of the capability. Some capabilities, such as those used in [card * issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different @@ -155,12 +175,21 @@ public static RequestedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private RequestedLevelEnum requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + public static final String JSON_PROPERTY_REQUESTED_SETTINGS = "requestedSettings"; private CapabilitySettings requestedSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedSettings = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENTS = "transferInstruments"; private List transferInstruments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstruments = false; + /** * The status of the verification checks for the capability. Possible values: * **pending**: Adyen * is running the verification. * **invalid**: The verification failed. Check if the @@ -215,6 +244,15 @@ public static VerificationStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private VerificationStatusEnum verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderCapability() {} @JsonCreator @@ -267,6 +305,7 @@ public AllowedLevelEnum getAllowedLevel() { */ public AccountHolderCapability allowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; + isSetAllowedSettings = true; // mark as set return this; } @@ -290,6 +329,7 @@ public CapabilitySettings getAllowedSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; + isSetAllowedSettings = true; // mark as set } /** @@ -302,6 +342,7 @@ public void setAllowedSettings(CapabilitySettings allowedSettings) { */ public AccountHolderCapability enabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set return this; } @@ -329,6 +370,7 @@ public Boolean getEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set } /** @@ -353,6 +395,7 @@ public List getProblems() { */ public AccountHolderCapability requested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set return this; } @@ -380,6 +423,7 @@ public Boolean getRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set } /** @@ -397,6 +441,7 @@ public void setRequested(Boolean requested) { */ public AccountHolderCapability requestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set return this; } @@ -434,6 +479,7 @@ public RequestedLevelEnum getRequestedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set } /** @@ -444,6 +490,7 @@ public void setRequestedLevel(RequestedLevelEnum requestedLevel) { */ public AccountHolderCapability requestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; + isSetRequestedSettings = true; // mark as set return this; } @@ -467,6 +514,7 @@ public CapabilitySettings getRequestedSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; + isSetRequestedSettings = true; // mark as set } /** @@ -500,6 +548,26 @@ public VerificationStatusEnum getVerificationStatus() { return verificationStatus; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderCapability includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + /** Return true if this AccountHolderCapability object is equal to o. */ @Override public boolean equals(Object o) { @@ -567,6 +635,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetAllowedSettings) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_SETTINGS, this.allowedSettings); + } + if (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetRequestedSettings) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_SETTINGS, this.requestedSettings); + } + if (isSetTransferInstruments) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENTS, this.transferInstruments); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountHolderCapability given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java index 873291221..cccb6cb55 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,32 +38,65 @@ public class AccountHolderInfo { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; @Deprecated // deprecated private ContactDetails contactDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContactDetails = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; private String migratedAccountHolderCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountHolderCode = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderInfo() {} @JsonCreator @@ -85,6 +120,7 @@ public AccountHolderInfo( */ public AccountHolderInfo balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -120,6 +156,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -135,6 +172,7 @@ public void setBalancePlatform(String balancePlatform) { */ public AccountHolderInfo capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -177,6 +215,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -189,6 +228,7 @@ public void setCapabilities(Map capabilities) { @Deprecated // deprecated public AccountHolderInfo contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set return this; } @@ -216,6 +256,7 @@ public ContactDetails getContactDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set } /** @@ -226,6 +267,7 @@ public void setContactDetails(ContactDetails contactDetails) { */ public AccountHolderInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -249,6 +291,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -265,6 +308,7 @@ public void setDescription(String description) { */ public AccountHolderInfo legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -300,6 +344,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -315,6 +360,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountHolderInfo metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -356,6 +402,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -378,6 +425,7 @@ public String getMigratedAccountHolderCode() { */ public AccountHolderInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -401,6 +449,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -416,6 +465,7 @@ public void setReference(String reference) { */ public AccountHolderInfo timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -449,6 +499,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AccountHolderInfo object is equal to o. */ @@ -516,6 +587,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetContactDetails) { + addIfNull(nulls, JSON_PROPERTY_CONTACT_DETAILS, this.contactDetails); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountHolderCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, this.migratedAccountHolderCode); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountHolderInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java index 48260784d..297da345b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,29 +44,53 @@ public class AccountHolderUpdateRequest { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; @Deprecated // deprecated private ContactDetails contactDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContactDetails = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; private String migratedAccountHolderCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountHolderCode = false; + public static final String JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; private String primaryBalanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrimaryBalanceAccount = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The status of the account holder. Possible values: * **active**: The account holder is active * and allowed to use its capabilities. This is the initial status for account holders and balance @@ -118,12 +144,27 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + public static final String JSON_PROPERTY_VERIFICATION_DEADLINES = "verificationDeadlines"; private List verificationDeadlines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationDeadlines = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderUpdateRequest() {} @JsonCreator @@ -150,6 +191,7 @@ public AccountHolderUpdateRequest( */ public AccountHolderUpdateRequest balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -185,6 +227,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -201,6 +244,7 @@ public void setBalancePlatform(String balancePlatform) { public AccountHolderUpdateRequest capabilities( Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -243,6 +287,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -255,6 +300,7 @@ public void setCapabilities(Map capabilities) { @Deprecated // deprecated public AccountHolderUpdateRequest contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set return this; } @@ -282,6 +328,7 @@ public ContactDetails getContactDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set } /** @@ -292,6 +339,7 @@ public void setContactDetails(ContactDetails contactDetails) { */ public AccountHolderUpdateRequest description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -315,6 +363,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -330,6 +379,7 @@ public void setDescription(String description) { */ public AccountHolderUpdateRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -371,6 +421,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -397,6 +448,7 @@ public String getMigratedAccountHolderCode() { */ public AccountHolderUpdateRequest primaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set return this; } @@ -428,6 +480,7 @@ public String getPrimaryBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrimaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set } /** @@ -438,6 +491,7 @@ public void setPrimaryBalanceAccount(String primaryBalanceAccount) { */ public AccountHolderUpdateRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -461,6 +515,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -482,6 +537,7 @@ public void setReference(String reference) { */ public AccountHolderUpdateRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -527,6 +583,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -542,6 +599,7 @@ public void setStatus(StatusEnum status) { */ public AccountHolderUpdateRequest timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -575,6 +633,7 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set } /** @@ -590,6 +649,26 @@ public List getVerificationDeadlines() { return verificationDeadlines; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderUpdateRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + /** Return true if this AccountHolderUpdateRequest object is equal to o. */ @Override public boolean equals(Object o) { @@ -667,6 +746,60 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetContactDetails) { + addIfNull(nulls, JSON_PROPERTY_CONTACT_DETAILS, this.contactDetails); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountHolderCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, this.migratedAccountHolderCode); + } + if (isSetPrimaryBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT, this.primaryBalanceAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + if (isSetVerificationDeadlines) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_DEADLINES, this.verificationDeadlines); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountHolderUpdateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java index 9344d2af8..755e314d1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,6 +37,9 @@ public class AccountSupportingEntityCapability { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + /** * The capability level that is allowed for the account holder. Possible values: * **notApplicable**, **low**, **medium**, **high**. @@ -86,15 +91,27 @@ public static AllowedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private AllowedLevelEnum allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; private Boolean enabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + /** * The requested level of the capability. Some capabilities, such as those used in [card * issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different @@ -148,6 +165,9 @@ public static RequestedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private RequestedLevelEnum requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + /** * The status of the verification checks for the supporting entity capability. Possible values: * * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check @@ -202,6 +222,15 @@ public static VerificationStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private VerificationStatusEnum verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountSupportingEntityCapability() {} @JsonCreator @@ -255,6 +284,7 @@ public AllowedLevelEnum getAllowedLevel() { */ public AccountSupportingEntityCapability enabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set return this; } @@ -282,6 +312,7 @@ public Boolean getEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set } /** @@ -306,6 +337,7 @@ public String getId() { */ public AccountSupportingEntityCapability requested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set return this; } @@ -333,6 +365,7 @@ public Boolean getRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set } /** @@ -351,6 +384,7 @@ public void setRequested(Boolean requested) { */ public AccountSupportingEntityCapability requestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set return this; } @@ -388,6 +422,7 @@ public RequestedLevelEnum getRequestedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set } /** @@ -409,6 +444,26 @@ public VerificationStatusEnum getVerificationStatus() { return verificationStatus; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountSupportingEntityCapability includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + /** Return true if this AccountSupportingEntityCapability object is equal to o. */ @Override public boolean equals(Object o) { @@ -461,6 +516,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountSupportingEntityCapability given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java b/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java index 6a4f3a8f1..bc500bcb6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class ActiveNetworkTokensRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Integer value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ActiveNetworkTokensRestriction() {} /** @@ -40,6 +54,7 @@ public ActiveNetworkTokensRestriction() {} */ public ActiveNetworkTokensRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public ActiveNetworkTokensRestriction value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -97,6 +114,27 @@ public Integer getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Integer value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ActiveNetworkTokensRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ActiveNetworkTokensRestriction object is equal to o. */ @@ -139,6 +177,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ActiveNetworkTokensRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java index c28210f8c..8d0684174 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class AdditionalBankIdentification { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + /** * The type of additional bank identification, depending on the country. Possible values: * * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) @@ -89,6 +94,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalBankIdentification() {} /** @@ -99,6 +113,7 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -122,6 +137,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -150,6 +166,7 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -209,6 +226,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalBankIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalBankIdentification object is equal to o. */ @@ -250,6 +288,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentificationRequirement.java b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentificationRequirement.java index 179aea932..08a91ccde 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentificationRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentificationRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -89,9 +91,15 @@ public static AdditionalBankIdentificationTypeEnum fromValue(String value) { "additionalBankIdentificationType"; private AdditionalBankIdentificationTypeEnum additionalBankIdentificationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentificationType = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **additionalBankIdentificationRequirement** */ public enum TypeEnum { ADDITIONALBANKIDENTIFICATIONREQUIREMENT( @@ -135,6 +143,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalBankIdentificationRequirement() {} /** @@ -165,6 +182,7 @@ public AdditionalBankIdentificationRequirement() {} public AdditionalBankIdentificationRequirement additionalBankIdentificationType( AdditionalBankIdentificationTypeEnum additionalBankIdentificationType) { this.additionalBankIdentificationType = additionalBankIdentificationType; + isSetAdditionalBankIdentificationType = true; // mark as set return this; } @@ -225,6 +243,7 @@ public AdditionalBankIdentificationTypeEnum getAdditionalBankIdentificationType( public void setAdditionalBankIdentificationType( AdditionalBankIdentificationTypeEnum additionalBankIdentificationType) { this.additionalBankIdentificationType = additionalBankIdentificationType; + isSetAdditionalBankIdentificationType = true; // mark as set } /** @@ -236,6 +255,7 @@ public void setAdditionalBankIdentificationType( */ public AdditionalBankIdentificationRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -259,6 +279,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -270,6 +291,7 @@ public void setDescription(String description) { */ public AdditionalBankIdentificationRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -293,6 +315,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalBankIdentificationRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalBankIdentificationRequirement object is equal to o. */ @@ -341,6 +384,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalBankIdentificationType) { + addIfNull( + nulls, + JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION_TYPE, + this.additionalBankIdentificationType); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalBankIdentificationRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Address.java b/src/main/java/com/adyen/model/balanceplatform/Address.java index 314642ec9..6142a5604 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Address.java +++ b/src/main/java/com/adyen/model/balanceplatform/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Address { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; private String houseNumberOrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHouseNumberOrName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + public static final String JSON_PROPERTY_STREET = "street"; private String street; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStreet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Address() {} /** @@ -55,6 +81,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -92,6 +120,7 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -123,6 +152,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setCountry(String country) { */ public Address houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -156,6 +187,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -168,6 +200,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -207,6 +241,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -234,6 +269,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -247,6 +283,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public Address street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -276,6 +313,27 @@ public String getStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStreet(String street) { this.street = street; + isSetStreet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Address includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Address object is equal to o. */ @@ -325,6 +383,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + if (isSetStreet) { + addIfNull(nulls, JSON_PROPERTY_STREET, this.street); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Address given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AddressRequirement.java b/src/main/java/com/adyen/model/balanceplatform/AddressRequirement.java index e5f9be663..aa7609591 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AddressRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/AddressRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,6 +35,9 @@ public class AddressRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** Gets or Sets requiredAddressFields */ public enum RequiredAddressFieldsEnum { CITY(String.valueOf("city")), @@ -83,6 +88,9 @@ public static RequiredAddressFieldsEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUIRED_ADDRESS_FIELDS = "requiredAddressFields"; private List requiredAddressFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequiredAddressFields = false; + /** **addressRequirement** */ public enum TypeEnum { ADDRESSREQUIREMENT(String.valueOf("addressRequirement")); @@ -125,6 +133,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AddressRequirement() {} /** @@ -135,6 +152,7 @@ public AddressRequirement() {} */ public AddressRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -158,6 +176,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -169,6 +188,7 @@ public void setDescription(String description) { public AddressRequirement requiredAddressFields( List requiredAddressFields) { this.requiredAddressFields = requiredAddressFields; + isSetRequiredAddressFields = true; // mark as set return this; } @@ -201,6 +221,7 @@ public List getRequiredAddressFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequiredAddressFields(List requiredAddressFields) { this.requiredAddressFields = requiredAddressFields; + isSetRequiredAddressFields = true; // mark as set } /** @@ -211,6 +232,7 @@ public void setRequiredAddressFields(List requiredAdd */ public AddressRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -234,6 +256,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AddressRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AddressRequirement object is equal to o. */ @@ -279,6 +322,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetRequiredAddressFields) { + addIfNull(nulls, JSON_PROPERTY_REQUIRED_ADDRESS_FIELDS, this.requiredAddressFields); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AddressRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Amount.java b/src/main/java/com/adyen/model/balanceplatform/Amount.java index 4cad929f3..7162cab4b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Amount.java +++ b/src/main/java/com/adyen/model/balanceplatform/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,30 +25,47 @@ public class Amount { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Long value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * @return the current {@code Amount} instance, allowing for method chaining */ public Amount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @return currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,35 +75,39 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * @return the current {@code Amount} instance, allowing for method chaining */ public Amount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @return value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @@ -94,16 +117,37 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Amount object is equal to o. */ @@ -145,6 +189,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Amount given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AmountMinMaxRequirement.java b/src/main/java/com/adyen/model/balanceplatform/AmountMinMaxRequirement.java index d46f7786d..91550b3a1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AmountMinMaxRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/AmountMinMaxRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,12 +34,21 @@ public class AmountMinMaxRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_MAX = "max"; private Long max; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMax = false; + public static final String JSON_PROPERTY_MIN = "min"; private Long min; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMin = false; + /** **amountMinMaxRequirement** */ public enum TypeEnum { AMOUNTMINMAXREQUIREMENT(String.valueOf("amountMinMaxRequirement")); @@ -80,6 +91,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AmountMinMaxRequirement() {} /** @@ -90,6 +110,7 @@ public AmountMinMaxRequirement() {} */ public AmountMinMaxRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setDescription(String description) { */ public AmountMinMaxRequirement max(Long max) { this.max = max; + isSetMax = true; // mark as set return this; } @@ -146,6 +169,7 @@ public Long getMax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMax(Long max) { this.max = max; + isSetMax = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setMax(Long max) { */ public AmountMinMaxRequirement min(Long min) { this.min = min; + isSetMin = true; // mark as set return this; } @@ -179,6 +204,7 @@ public Long getMin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMin(Long min) { this.min = min; + isSetMin = true; // mark as set } /** @@ -189,6 +215,7 @@ public void setMin(Long min) { */ public AmountMinMaxRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -212,6 +239,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountMinMaxRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AmountMinMaxRequirement object is equal to o. */ @@ -257,6 +305,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetMax) { + addIfNull(nulls, JSON_PROPERTY_MAX, this.max); + } + if (isSetMin) { + addIfNull(nulls, JSON_PROPERTY_MIN, this.min); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AmountMinMaxRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AmountNonZeroDecimalsRequirement.java b/src/main/java/com/adyen/model/balanceplatform/AmountNonZeroDecimalsRequirement.java index 935aad63b..ddae8dde4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AmountNonZeroDecimalsRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/AmountNonZeroDecimalsRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class AmountNonZeroDecimalsRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **amountNonZeroDecimalsRequirement** */ public enum TypeEnum { AMOUNTNONZERODECIMALSREQUIREMENT(String.valueOf("amountNonZeroDecimalsRequirement")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AmountNonZeroDecimalsRequirement() {} /** @@ -86,6 +100,7 @@ public AmountNonZeroDecimalsRequirement() {} */ public AmountNonZeroDecimalsRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -115,6 +130,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -126,6 +142,7 @@ public void setDescription(String description) { */ public AmountNonZeroDecimalsRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -149,6 +166,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountNonZeroDecimalsRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AmountNonZeroDecimalsRequirement object is equal to o. */ @@ -191,6 +229,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AmountNonZeroDecimalsRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationRequest.java b/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationRequest.java index c1833fecc..b64dc1f8d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,15 +32,33 @@ public class ApproveAssociationRequest { public static final String JSON_PROPERTY_ENTITY_ID = "entityId"; private String entityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private ScaEntityType entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_SCA_DEVICE_IDS = "scaDeviceIds"; private List scaDeviceIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceIds = false; + public static final String JSON_PROPERTY_STATUS = "status"; private AssociationStatus status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApproveAssociationRequest() {} /** @@ -49,6 +69,7 @@ public ApproveAssociationRequest() {} */ public ApproveAssociationRequest entityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set return this; } @@ -72,6 +93,7 @@ public String getEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set } /** @@ -82,6 +104,7 @@ public void setEntityId(String entityId) { */ public ApproveAssociationRequest entityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -105,6 +128,7 @@ public ScaEntityType getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -115,6 +139,7 @@ public void setEntityType(ScaEntityType entityType) { */ public ApproveAssociationRequest scaDeviceIds(List scaDeviceIds) { this.scaDeviceIds = scaDeviceIds; + isSetScaDeviceIds = true; // mark as set return this; } @@ -146,6 +171,7 @@ public List getScaDeviceIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceIds(List scaDeviceIds) { this.scaDeviceIds = scaDeviceIds; + isSetScaDeviceIds = true; // mark as set } /** @@ -156,6 +182,7 @@ public void setScaDeviceIds(List scaDeviceIds) { */ public ApproveAssociationRequest status(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -179,6 +206,27 @@ public AssociationStatus getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApproveAssociationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApproveAssociationRequest object is equal to o. */ @@ -224,6 +272,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntityId) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ID, this.entityId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetScaDeviceIds) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_IDS, this.scaDeviceIds); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApproveAssociationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationResponse.java b/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationResponse.java index b4b635d03..ca7a32124 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class ApproveAssociationResponse { public static final String JSON_PROPERTY_SCA_ASSOCIATIONS = "scaAssociations"; private List scaAssociations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaAssociations = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApproveAssociationResponse() {} /** @@ -35,6 +46,7 @@ public ApproveAssociationResponse() {} */ public ApproveAssociationResponse scaAssociations(List scaAssociations) { this.scaAssociations = scaAssociations; + isSetScaAssociations = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getScaAssociations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaAssociations(List scaAssociations) { this.scaAssociations = scaAssociations; + isSetScaAssociations = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApproveAssociationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApproveAssociationResponse object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetScaAssociations) { + addIfNull(nulls, JSON_PROPERTY_SCA_ASSOCIATIONS, this.scaAssociations); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApproveAssociationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ApproveTransferLimitRequest.java b/src/main/java/com/adyen/model/balanceplatform/ApproveTransferLimitRequest.java index 929efbb85..d52c737dc 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ApproveTransferLimitRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/ApproveTransferLimitRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class ApproveTransferLimitRequest { public static final String JSON_PROPERTY_TRANSFER_LIMIT_IDS = "transferLimitIds"; private List transferLimitIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferLimitIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApproveTransferLimitRequest() {} /** @@ -37,6 +48,7 @@ public ApproveTransferLimitRequest() {} */ public ApproveTransferLimitRequest transferLimitIds(List transferLimitIds) { this.transferLimitIds = transferLimitIds; + isSetTransferLimitIds = true; // mark as set return this; } @@ -72,6 +84,27 @@ public List getTransferLimitIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferLimitIds(List transferLimitIds) { this.transferLimitIds = transferLimitIds; + isSetTransferLimitIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApproveTransferLimitRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApproveTransferLimitRequest object is equal to o. */ @@ -111,6 +144,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransferLimitIds) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_LIMIT_IDS, this.transferLimitIds); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApproveTransferLimitRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Association.java b/src/main/java/com/adyen/model/balanceplatform/Association.java index 8790afdde..b3f8ce1e4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Association.java +++ b/src/main/java/com/adyen/model/balanceplatform/Association.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class Association { public static final String JSON_PROPERTY_ENTITY_ID = "entityId"; private String entityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private ScaEntityType entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_SCA_DEVICE_ID = "scaDeviceId"; private String scaDeviceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private AssociationStatus status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Association() {} /** @@ -47,6 +67,7 @@ public Association() {} */ public Association entityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setEntityId(String entityId) { */ public Association entityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -103,6 +126,7 @@ public ScaEntityType getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setEntityType(ScaEntityType entityType) { */ public Association scaDeviceId(String scaDeviceId) { this.scaDeviceId = scaDeviceId; + isSetScaDeviceId = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getScaDeviceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceId(String scaDeviceId) { this.scaDeviceId = scaDeviceId; + isSetScaDeviceId = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setScaDeviceId(String scaDeviceId) { */ public Association status(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -169,6 +196,27 @@ public AssociationStatus getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Association includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Association object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntityId) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ID, this.entityId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetScaDeviceId) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_ID, this.scaDeviceId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Association given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationDelegatedAuthenticationData.java b/src/main/java/com/adyen/model/balanceplatform/AssociationDelegatedAuthenticationData.java index 9110d316e..cf88382f4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationDelegatedAuthenticationData.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationDelegatedAuthenticationData.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class AssociationDelegatedAuthenticationData { public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AssociationDelegatedAuthenticationData() {} /** @@ -36,6 +47,7 @@ public AssociationDelegatedAuthenticationData() {} */ public AssociationDelegatedAuthenticationData sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationDelegatedAuthenticationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AssociationDelegatedAuthenticationData object is equal to o. */ @@ -103,6 +136,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AssociationDelegatedAuthenticationData given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseRequest.java b/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseRequest.java index a12d143a7..ffb7cdf44 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,10 +35,16 @@ public class AssociationFinaliseRequest { public static final String JSON_PROPERTY_IDS = "ids"; private List ids; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIds = false; + public static final String JSON_PROPERTY_STRONG_CUSTOMER_AUTHENTICATION = "strongCustomerAuthentication"; private AssociationDelegatedAuthenticationData strongCustomerAuthentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStrongCustomerAuthentication = false; + /** * The type of resource that you are associating with the SCA device. Possible value: * **PaymentInstrument** @@ -82,6 +90,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AssociationFinaliseRequest() {} /** @@ -94,6 +111,7 @@ public AssociationFinaliseRequest() {} */ public AssociationFinaliseRequest ids(List ids) { this.ids = ids; + isSetIds = true; // mark as set return this; } @@ -129,6 +147,7 @@ public List getIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIds(List ids) { this.ids = ids; + isSetIds = true; // mark as set } /** @@ -140,6 +159,7 @@ public void setIds(List ids) { public AssociationFinaliseRequest strongCustomerAuthentication( AssociationDelegatedAuthenticationData strongCustomerAuthentication) { this.strongCustomerAuthentication = strongCustomerAuthentication; + isSetStrongCustomerAuthentication = true; // mark as set return this; } @@ -164,6 +184,7 @@ public AssociationDelegatedAuthenticationData getStrongCustomerAuthentication() public void setStrongCustomerAuthentication( AssociationDelegatedAuthenticationData strongCustomerAuthentication) { this.strongCustomerAuthentication = strongCustomerAuthentication; + isSetStrongCustomerAuthentication = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setStrongCustomerAuthentication( */ public AssociationFinaliseRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -203,6 +225,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationFinaliseRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AssociationFinaliseRequest object is equal to o. */ @@ -250,6 +293,37 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIds) { + addIfNull(nulls, JSON_PROPERTY_IDS, this.ids); + } + if (isSetStrongCustomerAuthentication) { + addIfNull( + nulls, JSON_PROPERTY_STRONG_CUSTOMER_AUTHENTICATION, this.strongCustomerAuthentication); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AssociationFinaliseRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseResponse.java b/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseResponse.java index 5f88ae408..bdc2e7e11 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +35,15 @@ public class AssociationFinaliseResponse { public static final String JSON_PROPERTY_DEVICE_ID = "deviceId"; private String deviceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceId = false; + public static final String JSON_PROPERTY_IDS = "ids"; private List ids; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIds = false; + /** The type of resource that you associated with the SCA device. */ public enum TypeEnum { PAYMENT_INSTRUMENT(String.valueOf("PAYMENT_INSTRUMENT")); @@ -78,6 +86,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AssociationFinaliseResponse() {} /** @@ -88,6 +105,7 @@ public AssociationFinaliseResponse() {} */ public AssociationFinaliseResponse deviceId(String deviceId) { this.deviceId = deviceId; + isSetDeviceId = true; // mark as set return this; } @@ -111,6 +129,7 @@ public String getDeviceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceId(String deviceId) { this.deviceId = deviceId; + isSetDeviceId = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setDeviceId(String deviceId) { */ public AssociationFinaliseResponse ids(List ids) { this.ids = ids; + isSetIds = true; // mark as set return this; } @@ -155,6 +175,7 @@ public List getIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIds(List ids) { this.ids = ids; + isSetIds = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setIds(List ids) { */ public AssociationFinaliseResponse type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -188,6 +210,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationFinaliseResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AssociationFinaliseResponse object is equal to o. */ @@ -231,6 +274,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDeviceId) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_ID, this.deviceId); + } + if (isSetIds) { + addIfNull(nulls, JSON_PROPERTY_IDS, this.ids); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AssociationFinaliseResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateRequest.java b/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateRequest.java index 848ef857b..3e515eb38 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class AssociationInitiateRequest { public static final String JSON_PROPERTY_IDS = "ids"; private List ids; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIds = false; + /** * The type of resource that you are associating with the SCA device. Possible value: * **PaymentInstrument** @@ -77,6 +82,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AssociationInitiateRequest() {} /** @@ -89,6 +103,7 @@ public AssociationInitiateRequest() {} */ public AssociationInitiateRequest ids(List ids) { this.ids = ids; + isSetIds = true; // mark as set return this; } @@ -124,6 +139,7 @@ public List getIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIds(List ids) { this.ids = ids; + isSetIds = true; // mark as set } /** @@ -136,6 +152,7 @@ public void setIds(List ids) { */ public AssociationInitiateRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -163,6 +180,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationInitiateRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AssociationInitiateRequest object is equal to o. */ @@ -204,6 +242,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIds) { + addIfNull(nulls, JSON_PROPERTY_IDS, this.ids); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AssociationInitiateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateResponse.java b/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateResponse.java index ed4a2253c..3a93c2f15 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class AssociationInitiateResponse { public static final String JSON_PROPERTY_SDK_INPUT = "sdkInput"; private String sdkInput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AssociationInitiateResponse() {} /** @@ -34,6 +45,7 @@ public AssociationInitiateResponse() {} */ public AssociationInitiateResponse sdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set return this; } @@ -59,6 +71,27 @@ public String getSdkInput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationInitiateResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AssociationInitiateResponse object is equal to o. */ @@ -98,6 +131,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSdkInput) { + addIfNull(nulls, JSON_PROPERTY_SDK_INPUT, this.sdkInput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AssociationInitiateResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationListing.java b/src/main/java/com/adyen/model/balanceplatform/AssociationListing.java index d9607c7ec..9ca77e1e8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationListing.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationListing.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,24 +34,51 @@ public class AssociationListing { public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_ENTITY_ID = "entityId"; private String entityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private ScaEntityType entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_SCA_DEVICE_ID = "scaDeviceId"; private String scaDeviceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceId = false; + public static final String JSON_PROPERTY_SCA_DEVICE_NAME = "scaDeviceName"; private String scaDeviceName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceName = false; + public static final String JSON_PROPERTY_SCA_DEVICE_TYPE = "scaDeviceType"; private ScaDeviceType scaDeviceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceType = false; + public static final String JSON_PROPERTY_STATUS = "status"; private AssociationStatus status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AssociationListing() {} /** @@ -60,6 +89,7 @@ public AssociationListing() {} */ public AssociationListing createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -83,6 +113,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -93,6 +124,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public AssociationListing entityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set return this; } @@ -116,6 +148,7 @@ public String getEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set } /** @@ -126,6 +159,7 @@ public void setEntityId(String entityId) { */ public AssociationListing entityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -149,6 +183,7 @@ public ScaEntityType getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -159,6 +194,7 @@ public void setEntityType(ScaEntityType entityType) { */ public AssociationListing scaDeviceId(String scaDeviceId) { this.scaDeviceId = scaDeviceId; + isSetScaDeviceId = true; // mark as set return this; } @@ -182,6 +218,7 @@ public String getScaDeviceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceId(String scaDeviceId) { this.scaDeviceId = scaDeviceId; + isSetScaDeviceId = true; // mark as set } /** @@ -192,6 +229,7 @@ public void setScaDeviceId(String scaDeviceId) { */ public AssociationListing scaDeviceName(String scaDeviceName) { this.scaDeviceName = scaDeviceName; + isSetScaDeviceName = true; // mark as set return this; } @@ -215,6 +253,7 @@ public String getScaDeviceName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceName(String scaDeviceName) { this.scaDeviceName = scaDeviceName; + isSetScaDeviceName = true; // mark as set } /** @@ -225,6 +264,7 @@ public void setScaDeviceName(String scaDeviceName) { */ public AssociationListing scaDeviceType(ScaDeviceType scaDeviceType) { this.scaDeviceType = scaDeviceType; + isSetScaDeviceType = true; // mark as set return this; } @@ -248,6 +288,7 @@ public ScaDeviceType getScaDeviceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceType(ScaDeviceType scaDeviceType) { this.scaDeviceType = scaDeviceType; + isSetScaDeviceType = true; // mark as set } /** @@ -258,6 +299,7 @@ public void setScaDeviceType(ScaDeviceType scaDeviceType) { */ public AssociationListing status(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -281,6 +323,27 @@ public AssociationStatus getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationListing includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AssociationListing object is equal to o. */ @@ -333,6 +396,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetEntityId) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ID, this.entityId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetScaDeviceId) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_ID, this.scaDeviceId); + } + if (isSetScaDeviceName) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_NAME, this.scaDeviceName); + } + if (isSetScaDeviceType) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_TYPE, this.scaDeviceType); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AssociationListing given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Authentication.java b/src/main/java/com/adyen/model/balanceplatform/Authentication.java index b1ca55240..08bbea000 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Authentication.java +++ b/src/main/java/com/adyen/model/balanceplatform/Authentication.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class Authentication { public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_PASSWORD = "password"; private String password; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassword = false; + public static final String JSON_PROPERTY_PHONE = "phone"; private Phone phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Authentication() {} /** @@ -43,6 +60,7 @@ public Authentication() {} */ public Authentication email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setEmail(String email) { */ public Authentication password(String password) { this.password = password; + isSetPassword = true; // mark as set return this; } @@ -117,6 +137,7 @@ public String getPassword() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassword(String password) { this.password = password; + isSetPassword = true; // mark as set } /** @@ -127,6 +148,7 @@ public void setPassword(String password) { */ public Authentication phone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -150,6 +172,27 @@ public Phone getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Authentication includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Authentication object is equal to o. */ @@ -193,6 +236,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetPassword) { + addIfNull(nulls, JSON_PROPERTY_PASSWORD, this.password); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Authentication given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AuthorisedCardUsers.java b/src/main/java/com/adyen/model/balanceplatform/AuthorisedCardUsers.java index fae830b57..49e4758c3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AuthorisedCardUsers.java +++ b/src/main/java/com/adyen/model/balanceplatform/AuthorisedCardUsers.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class AuthorisedCardUsers { public static final String JSON_PROPERTY_LEGAL_ENTITY_IDS = "legalEntityIds"; private List legalEntityIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthorisedCardUsers() {} /** @@ -36,6 +47,7 @@ public AuthorisedCardUsers() {} */ public AuthorisedCardUsers legalEntityIds(List legalEntityIds) { this.legalEntityIds = legalEntityIds; + isSetLegalEntityIds = true; // mark as set return this; } @@ -69,6 +81,27 @@ public List getLegalEntityIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityIds(List legalEntityIds) { this.legalEntityIds = legalEntityIds; + isSetLegalEntityIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthorisedCardUsers includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AuthorisedCardUsers object is equal to o. */ @@ -108,6 +141,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLegalEntityIds) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_IDS, this.legalEntityIds); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AuthorisedCardUsers given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java index 163d24a87..d925cba96 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class BRLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_ISPB = "ispb"; private String ispb; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIspb = false; + /** **brLocal** */ public enum TypeEnum { BRLOCAL(String.valueOf("brLocal")); @@ -84,6 +98,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BRLocalAccountIdentification() {} /** @@ -94,6 +117,7 @@ public BRLocalAccountIdentification() {} */ public BRLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAccountNumber(String accountNumber) { */ public BRLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setBankCode(String bankCode) { */ public BRLocalAccountIdentification branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -193,6 +222,7 @@ public void setBranchNumber(String branchNumber) { */ public BRLocalAccountIdentification ispb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set return this; } @@ -216,6 +246,7 @@ public String getIspb() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIspb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set } /** @@ -226,6 +257,7 @@ public void setIspb(String ispb) { */ public BRLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -249,6 +281,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BRLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BRLocalAccountIdentification object is equal to o. */ @@ -296,6 +349,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetIspb) { + addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BRLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Balance.java b/src/main/java/com/adyen/model/balanceplatform/Balance.java index 8d4a8c88f..b7531d3c0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Balance.java +++ b/src/main/java/com/adyen/model/balanceplatform/Balance.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,24 +25,52 @@ Balance.JSON_PROPERTY_BALANCE, Balance.JSON_PROPERTY_CURRENCY, Balance.JSON_PROPERTY_PENDING, + Balance.JSON_PROPERTY_PENDING_AVAILABLE, Balance.JSON_PROPERTY_RESERVED }) public class Balance { public static final String JSON_PROPERTY_AVAILABLE = "available"; private Long available; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvailable = false; + public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_PENDING = "pending"; private Long pending; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPending = false; + + public static final String JSON_PROPERTY_PENDING_AVAILABLE = "pendingAvailable"; + private Long pendingAvailable; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPendingAvailable = false; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Balance() {} /** @@ -51,6 +81,7 @@ public Balance() {} */ public Balance available(Long available) { this.available = available; + isSetAvailable = true; // mark as set return this; } @@ -74,6 +105,7 @@ public Long getAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvailable(Long available) { this.available = available; + isSetAvailable = true; // mark as set } /** @@ -84,6 +116,7 @@ public void setAvailable(Long available) { */ public Balance balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -107,6 +140,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -119,6 +153,7 @@ public void setBalance(Long balance) { */ public Balance currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -146,6 +181,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -156,6 +192,7 @@ public void setCurrency(String currency) { */ public Balance pending(Long pending) { this.pending = pending; + isSetPending = true; // mark as set return this; } @@ -179,6 +216,36 @@ public Long getPending() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPending(Long pending) { this.pending = pending; + isSetPending = true; // mark as set + } + + /** + * @param pendingAvailable + * @return the current {@code Balance} instance, allowing for method chaining + */ + public Balance pendingAvailable(Long pendingAvailable) { + this.pendingAvailable = pendingAvailable; + isSetPendingAvailable = true; // mark as set + return this; + } + + /** + * @return pendingAvailable + */ + @JsonProperty(JSON_PROPERTY_PENDING_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPendingAvailable() { + return pendingAvailable; + } + + /** + * @param pendingAvailable + */ + @JsonProperty(JSON_PROPERTY_PENDING_AVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPendingAvailable(Long pendingAvailable) { + this.pendingAvailable = pendingAvailable; + isSetPendingAvailable = true; // mark as set } /** @@ -189,6 +256,7 @@ public void setPending(Long pending) { */ public Balance reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -212,6 +280,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Balance includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Balance object is equal to o. */ @@ -228,12 +317,13 @@ public boolean equals(Object o) { && Objects.equals(this.balance, balance.balance) && Objects.equals(this.currency, balance.currency) && Objects.equals(this.pending, balance.pending) + && Objects.equals(this.pendingAvailable, balance.pendingAvailable) && Objects.equals(this.reserved, balance.reserved); } @Override public int hashCode() { - return Objects.hash(available, balance, currency, pending, reserved); + return Objects.hash(available, balance, currency, pending, pendingAvailable, reserved); } @Override @@ -244,6 +334,7 @@ public String toString() { sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" pending: ").append(toIndentedString(pending)).append("\n"); + sb.append(" pendingAvailable: ").append(toIndentedString(pendingAvailable)).append("\n"); sb.append(" reserved: ").append(toIndentedString(reserved)).append("\n"); sb.append("}"); return sb.toString(); @@ -259,6 +350,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAvailable) { + addIfNull(nulls, JSON_PROPERTY_AVAILABLE, this.available); + } + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetPending) { + addIfNull(nulls, JSON_PROPERTY_PENDING, this.pending); + } + if (isSetPendingAvailable) { + addIfNull(nulls, JSON_PROPERTY_PENDING_AVAILABLE, this.pendingAvailable); + } + if (isSetReserved) { + addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Balance given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java index 61c175894..c52fc165f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -43,31 +45,58 @@ public class BalanceAccount { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_DEFAULT_CURRENCY_CODE = "defaultCurrencyCode"; private String defaultCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrencyCode = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; private String migratedAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountCode = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of the balance account, set to **active** by default. */ public enum StatusEnum { ACTIVE(String.valueOf("active")), @@ -116,9 +145,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccount() {} @JsonCreator @@ -140,6 +181,7 @@ public BalanceAccount( */ public BalanceAccount accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -171,6 +213,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -181,6 +224,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccount balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -212,6 +256,7 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -230,6 +275,7 @@ public void setBalances(List balances) { */ public BalanceAccount defaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set return this; } @@ -269,6 +315,7 @@ public String getDefaultCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set } /** @@ -282,6 +329,7 @@ public void setDefaultCurrencyCode(String defaultCurrencyCode) { */ public BalanceAccount description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -311,6 +359,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -321,6 +370,7 @@ public void setDescription(String description) { */ public BalanceAccount id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -344,6 +394,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -359,6 +410,7 @@ public void setId(String id) { */ public BalanceAccount metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -400,6 +452,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -423,6 +476,7 @@ public String getMigratedAccountCode() { public BalanceAccount platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -447,6 +501,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -457,6 +512,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccount reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -480,6 +536,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -490,6 +547,7 @@ public void setReference(String reference) { */ public BalanceAccount status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -513,6 +571,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -528,6 +587,7 @@ public void setStatus(StatusEnum status) { */ public BalanceAccount timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -561,6 +621,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceAccount object is equal to o. */ @@ -638,6 +719,61 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetDefaultCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY_CODE, this.defaultCurrencyCode); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, this.migratedAccountCode); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java index 5ffc89b49..fc0a6635b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -40,28 +42,52 @@ public class BalanceAccountBase { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_DEFAULT_CURRENCY_CODE = "defaultCurrencyCode"; private String defaultCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrencyCode = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; private String migratedAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountCode = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of the balance account, set to **active** by default. */ public enum StatusEnum { ACTIVE(String.valueOf("active")), @@ -110,9 +136,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountBase() {} @JsonCreator @@ -134,6 +172,7 @@ public BalanceAccountBase( */ public BalanceAccountBase accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -165,6 +204,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -183,6 +223,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccountBase defaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set return this; } @@ -222,6 +263,7 @@ public String getDefaultCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set } /** @@ -235,6 +277,7 @@ public void setDefaultCurrencyCode(String defaultCurrencyCode) { */ public BalanceAccountBase description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -264,6 +307,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -274,6 +318,7 @@ public void setDescription(String description) { */ public BalanceAccountBase id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -297,6 +342,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -312,6 +358,7 @@ public void setId(String id) { */ public BalanceAccountBase metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -353,6 +400,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -376,6 +424,7 @@ public String getMigratedAccountCode() { public BalanceAccountBase platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -400,6 +449,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -410,6 +460,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccountBase reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -433,6 +484,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -443,6 +495,7 @@ public void setReference(String reference) { */ public BalanceAccountBase status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -466,6 +519,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -481,6 +535,7 @@ public void setStatus(StatusEnum status) { */ public BalanceAccountBase timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -514,6 +569,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountBase includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceAccountBase object is equal to o. */ @@ -588,6 +664,58 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetDefaultCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY_CODE, this.defaultCurrencyCode); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, this.migratedAccountCode); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceAccountBase given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java index f708e38b7..1a4757059 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,28 +37,58 @@ public class BalanceAccountInfo { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_DEFAULT_CURRENCY_CODE = "defaultCurrencyCode"; private String defaultCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrencyCode = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; private String migratedAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountCode = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountInfo() {} @JsonCreator @@ -78,6 +110,7 @@ public BalanceAccountInfo( */ public BalanceAccountInfo accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -109,6 +142,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -127,6 +161,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccountInfo defaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set return this; } @@ -166,6 +201,7 @@ public String getDefaultCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set } /** @@ -179,6 +215,7 @@ public void setDefaultCurrencyCode(String defaultCurrencyCode) { */ public BalanceAccountInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -208,6 +245,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -223,6 +261,7 @@ public void setDescription(String description) { */ public BalanceAccountInfo metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -264,6 +303,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -287,6 +327,7 @@ public String getMigratedAccountCode() { public BalanceAccountInfo platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -311,6 +352,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -321,6 +363,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccountInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -344,6 +387,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -359,6 +403,7 @@ public void setReference(String reference) { */ public BalanceAccountInfo timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -392,6 +437,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceAccountInfo object is equal to o. */ @@ -460,6 +526,52 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetDefaultCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY_CODE, this.defaultCurrencyCode); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, this.migratedAccountCode); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceAccountInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java index 5cd3126b2..7ffd41bb5 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,19 +39,34 @@ public class BalanceAccountUpdateRequest { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The status of the balance account. Payment instruments linked to the balance account can only * be used if the balance account status is **active**. Possible values: **active**, **closed**, @@ -102,9 +119,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountUpdateRequest() {} /** @@ -119,6 +148,7 @@ public BalanceAccountUpdateRequest() {} */ public BalanceAccountUpdateRequest accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -150,6 +180,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -162,6 +193,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccountUpdateRequest description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -189,6 +221,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -204,6 +237,7 @@ public void setDescription(String description) { */ public BalanceAccountUpdateRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -245,6 +279,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -256,6 +291,7 @@ public void setMetadata(Map metadata) { public BalanceAccountUpdateRequest platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -280,6 +316,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -290,6 +327,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccountUpdateRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -313,6 +351,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -327,6 +366,7 @@ public void setReference(String reference) { */ public BalanceAccountUpdateRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -358,6 +398,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -373,6 +414,7 @@ public void setStatus(StatusEnum status) { */ public BalanceAccountUpdateRequest timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -406,6 +448,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountUpdateRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceAccountUpdateRequest object is equal to o. */ @@ -468,6 +531,49 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceAccountUpdateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java b/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java index af312dddc..abc379ec9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class BalancePlatform { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatform() {} /** @@ -43,6 +60,7 @@ public BalancePlatform() {} */ public BalancePlatform description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public BalancePlatform id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -111,6 +132,7 @@ public void setId(String id) { */ public BalancePlatform status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatform includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatform object is equal to o. */ @@ -181,6 +224,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatform given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java index 625bfc41b..4a87115ae 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,12 +31,27 @@ public class BalanceSweepConfigurationsResponse { public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + public static final String JSON_PROPERTY_SWEEPS = "sweeps"; private List sweeps; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweeps = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceSweepConfigurationsResponse() {} /** @@ -46,6 +63,7 @@ public BalanceSweepConfigurationsResponse() {} */ public BalanceSweepConfigurationsResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -69,6 +87,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -80,6 +99,7 @@ public void setHasNext(Boolean hasNext) { */ public BalanceSweepConfigurationsResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -103,6 +123,7 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set } /** @@ -114,6 +135,7 @@ public void setHasPrevious(Boolean hasPrevious) { */ public BalanceSweepConfigurationsResponse sweeps(List sweeps) { this.sweeps = sweeps; + isSetSweeps = true; // mark as set return this; } @@ -145,6 +167,27 @@ public List getSweeps() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweeps(List sweeps) { this.sweeps = sweeps; + isSetSweeps = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceSweepConfigurationsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceSweepConfigurationsResponse object is equal to o. */ @@ -189,6 +232,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + if (isSetSweeps) { + addIfNull(nulls, JSON_PROPERTY_SWEEPS, this.sweeps); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceSweepConfigurationsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSetting.java b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSetting.java index b115c25ff..cc91a6b40 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSetting.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSetting.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -38,6 +40,15 @@ public class BalanceWebhookSetting extends WebhookSetting { public static final String JSON_PROPERTY_CONDITIONS = "conditions"; private List conditions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConditions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceWebhookSetting() {} /** @@ -50,6 +61,7 @@ public BalanceWebhookSetting() {} */ public BalanceWebhookSetting conditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set return this; } @@ -85,6 +97,27 @@ public List getConditions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceWebhookSetting includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceWebhookSetting object is equal to o. */ @@ -132,6 +165,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(BalanceWebhookSetting.class, "type", mappings); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetConditions) { + addIfNull(nulls, JSON_PROPERTY_CONDITIONS, this.conditions); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceWebhookSetting given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfo.java index 5f084f64c..ebb9cf22c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class BalanceWebhookSettingInfo { public static final String JSON_PROPERTY_CONDITIONS = "conditions"; private List conditions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConditions = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + /** * The status of the webhook setting. Possible values: * **active**: You receive a balance webhook * if any of the conditions in this setting are met. * **inactive**: You do not receive a balance @@ -86,9 +94,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TARGET = "target"; private Target target; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTarget = false; + /** The type of the webhook you are configuring. Set to **balance**. */ public enum TypeEnum { BALANCE(String.valueOf("balance")); @@ -131,6 +145,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceWebhookSettingInfo() {} /** @@ -142,6 +165,7 @@ public BalanceWebhookSettingInfo() {} */ public BalanceWebhookSettingInfo conditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set return this; } @@ -175,6 +199,7 @@ public List getConditions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set } /** @@ -187,6 +212,7 @@ public void setConditions(List conditions) { */ public BalanceWebhookSettingInfo currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -214,6 +240,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -228,6 +255,7 @@ public void setCurrency(String currency) { */ public BalanceWebhookSettingInfo status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -259,6 +287,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -269,6 +298,7 @@ public void setStatus(StatusEnum status) { */ public BalanceWebhookSettingInfo target(Target target) { this.target = target; + isSetTarget = true; // mark as set return this; } @@ -292,6 +322,7 @@ public Target getTarget() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTarget(Target target) { this.target = target; + isSetTarget = true; // mark as set } /** @@ -302,6 +333,7 @@ public void setTarget(Target target) { */ public BalanceWebhookSettingInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -325,6 +357,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceWebhookSettingInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceWebhookSettingInfo object is equal to o. */ @@ -372,6 +425,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetConditions) { + addIfNull(nulls, JSON_PROPERTY_CONDITIONS, this.conditions); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTarget) { + addIfNull(nulls, JSON_PROPERTY_TARGET, this.target); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceWebhookSettingInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfoUpdate.java b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfoUpdate.java index dd077c2f3..66cf74afa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfoUpdate.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfoUpdate.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class BalanceWebhookSettingInfoUpdate { public static final String JSON_PROPERTY_CONDITIONS = "conditions"; private List conditions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConditions = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + /** * The status of the webhook setting. Possible values: * **active**: You receive a balance webhook * if any of the conditions in this setting are met. * **inactive**: You do not receive a balance @@ -86,9 +94,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TARGET = "target"; private TargetUpdate target; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTarget = false; + /** The type of the webhook you are configuring. Set to **balance**. */ public enum TypeEnum { BALANCE(String.valueOf("balance")); @@ -131,6 +145,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceWebhookSettingInfoUpdate() {} /** @@ -143,6 +166,7 @@ public BalanceWebhookSettingInfoUpdate() {} */ public BalanceWebhookSettingInfoUpdate conditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set return this; } @@ -176,6 +200,7 @@ public List getConditions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set } /** @@ -189,6 +214,7 @@ public void setConditions(List conditions) { */ public BalanceWebhookSettingInfoUpdate currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -216,6 +242,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -231,6 +258,7 @@ public void setCurrency(String currency) { */ public BalanceWebhookSettingInfoUpdate status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -262,6 +290,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -273,6 +302,7 @@ public void setStatus(StatusEnum status) { */ public BalanceWebhookSettingInfoUpdate target(TargetUpdate target) { this.target = target; + isSetTarget = true; // mark as set return this; } @@ -296,6 +326,7 @@ public TargetUpdate getTarget() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTarget(TargetUpdate target) { this.target = target; + isSetTarget = true; // mark as set } /** @@ -307,6 +338,7 @@ public void setTarget(TargetUpdate target) { */ public BalanceWebhookSettingInfoUpdate type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -330,6 +362,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceWebhookSettingInfoUpdate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceWebhookSettingInfoUpdate object is equal to o. */ @@ -378,6 +431,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetConditions) { + addIfNull(nulls, JSON_PROPERTY_CONDITIONS, this.conditions); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTarget) { + addIfNull(nulls, JSON_PROPERTY_TARGET, this.target); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceWebhookSettingInfoUpdate given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccount.java b/src/main/java/com/adyen/model/balanceplatform/BankAccount.java index 0e9722170..9a98f6ed2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccount.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BankAccount { public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountAccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccount() {} /** @@ -33,6 +44,7 @@ public BankAccount() {} */ public BankAccount accountIdentification(BankAccountAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -56,6 +68,27 @@ public BankAccountAccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankAccount object is equal to o. */ @@ -97,6 +130,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountDetails.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountDetails.java index 1e2a8749b..cb389aa5b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountDetails.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,27 +34,57 @@ public class BankAccountDetails { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private String accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private String formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountDetails() {} /** @@ -63,6 +95,7 @@ public BankAccountDetails() {} */ public BankAccountDetails accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -86,6 +119,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -97,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public BankAccountDetails accountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -122,6 +157,7 @@ public String getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -132,6 +168,7 @@ public void setAccountType(String accountType) { */ public BankAccountDetails branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -155,6 +192,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -175,6 +213,7 @@ public void setBranchNumber(String branchNumber) { */ public BankAccountDetails formFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -218,6 +257,7 @@ public String getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -230,6 +270,7 @@ public void setFormFactor(String formFactor) { */ public BankAccountDetails iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -257,6 +298,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -270,6 +312,7 @@ public void setIban(String iban) { */ public BankAccountDetails routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -299,6 +342,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -310,6 +354,7 @@ public void setRoutingNumber(String routingNumber) { */ public BankAccountDetails sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -335,6 +380,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -345,6 +391,7 @@ public void setSortCode(String sortCode) { */ public BankAccountDetails type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -368,6 +415,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankAccountDetails object is equal to o. */ @@ -422,6 +490,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankAccountDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java index 5e2c81059..e712a4bac 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -106,9 +108,15 @@ public static BankAccountIdentificationTypesEnum fromValue(String value) { "bankAccountIdentificationTypes"; private List bankAccountIdentificationTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountIdentificationTypes = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **bankAccountIdentificationTypeRequirement** */ public enum TypeEnum { BANKACCOUNTIDENTIFICATIONTYPEREQUIREMENT( @@ -152,6 +160,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountIdentificationTypeRequirement() {} /** @@ -165,6 +182,7 @@ public BankAccountIdentificationTypeRequirement() {} public BankAccountIdentificationTypeRequirement bankAccountIdentificationTypes( List bankAccountIdentificationTypes) { this.bankAccountIdentificationTypes = bankAccountIdentificationTypes; + isSetBankAccountIdentificationTypes = true; // mark as set return this; } @@ -200,6 +218,7 @@ public List getBankAccountIdentificationType public void setBankAccountIdentificationTypes( List bankAccountIdentificationTypes) { this.bankAccountIdentificationTypes = bankAccountIdentificationTypes; + isSetBankAccountIdentificationTypes = true; // mark as set } /** @@ -214,6 +233,7 @@ public void setBankAccountIdentificationTypes( */ public BankAccountIdentificationTypeRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -243,6 +263,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -254,6 +275,7 @@ public void setDescription(String description) { */ public BankAccountIdentificationTypeRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -277,6 +299,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountIdentificationTypeRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankAccountIdentificationTypeRequirement object is equal to o. */ @@ -325,6 +368,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBankAccountIdentificationTypes) { + addIfNull( + nulls, + JSON_PROPERTY_BANK_ACCOUNT_IDENTIFICATION_TYPES, + this.bankAccountIdentificationTypes); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankAccountIdentificationTypeRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java index fbe2d5565..cdb1c9311 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class BankAccountIdentificationValidationRequest { public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountIdentificationValidationRequestAccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountIdentificationValidationRequest() {} /** @@ -37,6 +48,7 @@ public BankAccountIdentificationValidationRequest() {} public BankAccountIdentificationValidationRequest accountIdentification( BankAccountIdentificationValidationRequestAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -62,6 +74,27 @@ public BankAccountIdentificationValidationRequest accountIdentification( public void setAccountIdentification( BankAccountIdentificationValidationRequestAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountIdentificationValidationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankAccountIdentificationValidationRequest object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankAccountIdentificationValidationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountModel.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountModel.java index 821cb6521..252744e02 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountModel.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountModel.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -77,6 +79,15 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private FormFactorEnum formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountModel() {} /** @@ -97,6 +108,7 @@ public BankAccountModel() {} */ public BankAccountModel formFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -140,6 +152,27 @@ public FormFactorEnum getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountModel includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankAccountModel object is equal to o. */ @@ -179,6 +212,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankAccountModel given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BankIdentification.java index 7c393dbe2..5a52b14b8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class BankIdentification { public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_IDENTIFICATION = "identification"; private String identification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentification = false; + /** * The type of the identification. Possible values: **iban**, **routingNumber**, **sortCode**, * **bic**. @@ -85,6 +93,15 @@ public static IdentificationTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_IDENTIFICATION_TYPE = "identificationType"; private IdentificationTypeEnum identificationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentificationType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankIdentification() {} /** @@ -97,6 +114,7 @@ public BankIdentification() {} */ public BankIdentification country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -124,6 +142,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -134,6 +153,7 @@ public void setCountry(String country) { */ public BankIdentification identification(String identification) { this.identification = identification; + isSetIdentification = true; // mark as set return this; } @@ -157,6 +177,7 @@ public String getIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentification(String identification) { this.identification = identification; + isSetIdentification = true; // mark as set } /** @@ -169,6 +190,7 @@ public void setIdentification(String identification) { */ public BankIdentification identificationType(IdentificationTypeEnum identificationType) { this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set return this; } @@ -196,6 +218,27 @@ public IdentificationTypeEnum getIdentificationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentificationType(IdentificationTypeEnum identificationType) { this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BankIdentification object is equal to o. */ @@ -239,6 +282,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetIdentification) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION, this.identification); + } + if (isSetIdentificationType) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION_TYPE, this.identificationType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationRequest.java b/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationRequest.java index cb12b21c4..424df2ae5 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class BeginScaDeviceRegistrationRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BeginScaDeviceRegistrationRequest() {} /** @@ -42,6 +56,7 @@ public BeginScaDeviceRegistrationRequest() {} */ public BeginScaDeviceRegistrationRequest name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -69,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -82,6 +98,7 @@ public void setName(String name) { */ public BeginScaDeviceRegistrationRequest sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -109,6 +126,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BeginScaDeviceRegistrationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BeginScaDeviceRegistrationRequest object is equal to o. */ @@ -151,6 +189,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BeginScaDeviceRegistrationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationResponse.java b/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationResponse.java index 21eb14e82..6d1f061fd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class BeginScaDeviceRegistrationResponse { public static final String JSON_PROPERTY_SCA_DEVICE = "scaDevice"; private ScaDevice scaDevice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDevice = false; + public static final String JSON_PROPERTY_SDK_INPUT = "sdkInput"; private String sdkInput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BeginScaDeviceRegistrationResponse() {} /** @@ -40,6 +54,7 @@ public BeginScaDeviceRegistrationResponse() {} */ public BeginScaDeviceRegistrationResponse scaDevice(ScaDevice scaDevice) { this.scaDevice = scaDevice; + isSetScaDevice = true; // mark as set return this; } @@ -63,6 +78,7 @@ public ScaDevice getScaDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDevice(ScaDevice scaDevice) { this.scaDevice = scaDevice; + isSetScaDevice = true; // mark as set } /** @@ -76,6 +92,7 @@ public void setScaDevice(ScaDevice scaDevice) { */ public BeginScaDeviceRegistrationResponse sdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set return this; } @@ -103,6 +120,27 @@ public String getSdkInput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BeginScaDeviceRegistrationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BeginScaDeviceRegistrationResponse object is equal to o. */ @@ -145,6 +183,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetScaDevice) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE, this.scaDevice); + } + if (isSetSdkInput) { + addIfNull(nulls, JSON_PROPERTY_SDK_INPUT, this.sdkInput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BeginScaDeviceRegistrationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java index fc760cce2..2d82f4639 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class BrandVariantsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BrandVariantsRestriction() {} /** @@ -41,6 +55,7 @@ public BrandVariantsRestriction() {} */ public BrandVariantsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -84,6 +100,7 @@ public void setOperation(String operation) { */ public BrandVariantsRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -135,6 +152,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BrandVariantsRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BrandVariantsRestriction object is equal to o. */ @@ -176,6 +214,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BrandVariantsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java b/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java index da8276fd7..0acbcca89 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java +++ b/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,6 +30,7 @@ BulkAddress.JSON_PROPERTY_LINE2, BulkAddress.JSON_PROPERTY_LINE3, BulkAddress.JSON_PROPERTY_MOBILE, + BulkAddress.JSON_PROPERTY_NAME, BulkAddress.JSON_PROPERTY_POSTAL_CODE, BulkAddress.JSON_PROPERTY_STATE_OR_PROVINCE, BulkAddress.JSON_PROPERTY_STREET @@ -36,39 +39,87 @@ public class BulkAddress { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private String company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; private String houseNumberOrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHouseNumberOrName = false; + public static final String JSON_PROPERTY_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_LINE3 = "line3"; private String line3; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine3 = false; + public static final String JSON_PROPERTY_MOBILE = "mobile"; private String mobile; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobile = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + public static final String JSON_PROPERTY_STREET = "street"; private String street; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStreet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BulkAddress() {} /** @@ -79,6 +130,7 @@ public BulkAddress() {} */ public BulkAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -102,6 +154,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -112,6 +165,7 @@ public void setCity(String city) { */ public BulkAddress company(String company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -135,6 +189,7 @@ public String getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(String company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -145,6 +200,7 @@ public void setCompany(String company) { */ public BulkAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -168,6 +224,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -178,6 +235,7 @@ public void setCountry(String country) { */ public BulkAddress email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -201,6 +259,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -211,6 +270,7 @@ public void setEmail(String email) { */ public BulkAddress houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -234,6 +294,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -246,6 +307,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public BulkAddress line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -273,6 +335,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -284,6 +347,7 @@ public void setLine1(String line1) { */ public BulkAddress line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -309,6 +373,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -319,6 +384,7 @@ public void setLine2(String line2) { */ public BulkAddress line3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set return this; } @@ -342,6 +408,7 @@ public String getLine3() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set } /** @@ -352,6 +419,7 @@ public void setLine3(String line3) { */ public BulkAddress mobile(String mobile) { this.mobile = mobile; + isSetMobile = true; // mark as set return this; } @@ -375,6 +443,42 @@ public String getMobile() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobile(String mobile) { this.mobile = mobile; + isSetMobile = true; // mark as set + } + + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @param name The recipient’s name (person or contact), for example ‘John Doe’. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @return name The recipient’s name (person or contact), for example ‘John Doe’. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @param name The recipient’s name (person or contact), for example ‘John Doe’. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set } /** @@ -387,6 +491,7 @@ public void setMobile(String mobile) { */ public BulkAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -414,6 +519,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -426,6 +532,7 @@ public void setPostalCode(String postalCode) { */ public BulkAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -453,6 +560,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -463,6 +571,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public BulkAddress street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -486,6 +595,27 @@ public String getStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStreet(String street) { this.street = street; + isSetStreet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BulkAddress includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BulkAddress object is equal to o. */ @@ -507,6 +637,7 @@ public boolean equals(Object o) { && Objects.equals(this.line2, bulkAddress.line2) && Objects.equals(this.line3, bulkAddress.line3) && Objects.equals(this.mobile, bulkAddress.mobile) + && Objects.equals(this.name, bulkAddress.name) && Objects.equals(this.postalCode, bulkAddress.postalCode) && Objects.equals(this.stateOrProvince, bulkAddress.stateOrProvince) && Objects.equals(this.street, bulkAddress.street); @@ -524,6 +655,7 @@ public int hashCode() { line2, line3, mobile, + name, postalCode, stateOrProvince, street); @@ -542,6 +674,7 @@ public String toString() { sb.append(" line2: ").append(toIndentedString(line2)).append("\n"); sb.append(" line3: ").append(toIndentedString(line3)).append("\n"); sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); sb.append(" street: ").append(toIndentedString(street)).append("\n"); @@ -559,6 +692,66 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetLine3) { + addIfNull(nulls, JSON_PROPERTY_LINE3, this.line3); + } + if (isSetMobile) { + addIfNull(nulls, JSON_PROPERTY_MOBILE, this.mobile); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + if (isSetStreet) { + addIfNull(nulls, JSON_PROPERTY_STREET, this.street); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BulkAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java index 9f3813481..cb87bd6ce 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,6 +35,9 @@ public class CALocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -79,12 +84,21 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_INSTITUTION_NUMBER = "institutionNumber"; private String institutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; private String transitNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + /** **caLocal** */ public enum TypeEnum { CALOCAL(String.valueOf("caLocal")); @@ -127,6 +141,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CALocalAccountIdentification() {} /** @@ -137,6 +160,7 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -160,6 +184,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -171,6 +196,7 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -196,6 +222,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -206,6 +233,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set return this; } @@ -229,6 +257,7 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set } /** @@ -239,6 +268,7 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set return this; } @@ -262,6 +292,7 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set } /** @@ -272,6 +303,7 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -295,6 +327,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CALocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CALocalAccountIdentification object is equal to o. */ @@ -342,6 +395,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java index ede24669a..19128febd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class CZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **czLocal** */ public enum TypeEnum { CZLOCAL(String.valueOf("czLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CZLocalAccountIdentification() {} /** @@ -94,6 +111,7 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -133,6 +151,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CZLocalAccountIdentification object is equal to o. */ @@ -242,6 +285,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblem.java b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblem.java index e2ad5d9a4..53a2137d8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblem.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class CapabilityProblem { public static final String JSON_PROPERTY_ENTITY = "entity"; private CapabilityProblemEntity entity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntity = false; + public static final String JSON_PROPERTY_VERIFICATION_ERRORS = "verificationErrors"; private List verificationErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationErrors = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblem() {} /** @@ -41,6 +55,7 @@ public CapabilityProblem() {} */ public CapabilityProblem entity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set return this; } @@ -64,6 +79,7 @@ public CapabilityProblemEntity getEntity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEntity(CapabilityProblemEntity entity) { */ public CapabilityProblem verificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getVerificationErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblem includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapabilityProblem object is equal to o. */ @@ -146,6 +184,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntity) { + addIfNull(nulls, JSON_PROPERTY_ENTITY, this.entity); + } + if (isSetVerificationErrors) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_ERRORS, this.verificationErrors); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapabilityProblem given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntity.java index d57710394..5ce6ea866 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntity.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,12 +36,21 @@ public class CapabilityProblemEntity { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OWNER = "owner"; private CapabilityProblemEntityRecursive owner; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwner = false; + /** Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -86,6 +97,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblemEntity() {} /** @@ -98,6 +118,7 @@ public CapabilityProblemEntity() {} */ public CapabilityProblemEntity documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -133,6 +154,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +165,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +189,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -176,6 +200,7 @@ public void setId(String id) { */ public CapabilityProblemEntity owner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set return this; } @@ -199,6 +224,7 @@ public CapabilityProblemEntityRecursive getOwner() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set } /** @@ -209,6 +235,7 @@ public void setOwner(CapabilityProblemEntityRecursive owner) { */ public CapabilityProblemEntity type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -232,6 +259,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblemEntity includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapabilityProblemEntity object is equal to o. */ @@ -277,6 +325,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOwner) { + addIfNull(nulls, JSON_PROPERTY_OWNER, this.owner); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapabilityProblemEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntityRecursive.java index d7acf7623..57ea60729 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntityRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class CapabilityProblemEntityRecursive { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -84,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblemEntityRecursive() {} /** @@ -97,6 +114,7 @@ public CapabilityProblemEntityRecursive() {} */ public CapabilityProblemEntityRecursive documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -132,6 +150,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntityRecursive id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -177,6 +198,7 @@ public void setId(String id) { */ public CapabilityProblemEntityRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -200,6 +222,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblemEntityRecursive includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapabilityProblemEntity-recursive object is equal to o. */ @@ -244,6 +287,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapabilityProblemEntityRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java b/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java index 7d5db1da1..ad0b960f8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,9 +39,15 @@ public class CapabilitySettings { public static final String JSON_PROPERTY_AMOUNT_PER_INDUSTRY = "amountPerIndustry"; private Map amountPerIndustry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountPerIndustry = false; + public static final String JSON_PROPERTY_AUTHORIZED_CARD_USERS = "authorizedCardUsers"; private Boolean authorizedCardUsers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorizedCardUsers = false; + /** Gets or Sets fundingSource */ public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), @@ -86,6 +94,9 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private List fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + /** */ public enum IntervalEnum { DAILY(String.valueOf("daily")), @@ -132,9 +143,21 @@ public static IntervalEnum fromValue(String value) { public static final String JSON_PROPERTY_INTERVAL = "interval"; private IntervalEnum interval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterval = false; + public static final String JSON_PROPERTY_MAX_AMOUNT = "maxAmount"; private Amount maxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilitySettings() {} /** @@ -143,6 +166,7 @@ public CapabilitySettings() {} */ public CapabilitySettings amountPerIndustry(Map amountPerIndustry) { this.amountPerIndustry = amountPerIndustry; + isSetAmountPerIndustry = true; // mark as set return this; } @@ -170,6 +194,7 @@ public Map getAmountPerIndustry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountPerIndustry(Map amountPerIndustry) { this.amountPerIndustry = amountPerIndustry; + isSetAmountPerIndustry = true; // mark as set } /** @@ -178,6 +203,7 @@ public void setAmountPerIndustry(Map amountPerIndustry) { */ public CapabilitySettings authorizedCardUsers(Boolean authorizedCardUsers) { this.authorizedCardUsers = authorizedCardUsers; + isSetAuthorizedCardUsers = true; // mark as set return this; } @@ -197,6 +223,7 @@ public Boolean getAuthorizedCardUsers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { this.authorizedCardUsers = authorizedCardUsers; + isSetAuthorizedCardUsers = true; // mark as set } /** @@ -205,6 +232,7 @@ public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { */ public CapabilitySettings fundingSource(List fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -232,6 +260,7 @@ public List getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(List fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -240,6 +269,7 @@ public void setFundingSource(List fundingSource) { */ public CapabilitySettings interval(IntervalEnum interval) { this.interval = interval; + isSetInterval = true; // mark as set return this; } @@ -259,6 +289,7 @@ public IntervalEnum getInterval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterval(IntervalEnum interval) { this.interval = interval; + isSetInterval = true; // mark as set } /** @@ -269,6 +300,7 @@ public void setInterval(IntervalEnum interval) { */ public CapabilitySettings maxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set return this; } @@ -292,6 +324,27 @@ public Amount getMaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilitySettings includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapabilitySettings object is equal to o. */ @@ -341,6 +394,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmountPerIndustry) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_PER_INDUSTRY, this.amountPerIndustry); + } + if (isSetAuthorizedCardUsers) { + addIfNull(nulls, JSON_PROPERTY_AUTHORIZED_CARD_USERS, this.authorizedCardUsers); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetInterval) { + addIfNull(nulls, JSON_PROPERTY_INTERVAL, this.interval); + } + if (isSetMaxAmount) { + addIfNull(nulls, JSON_PROPERTY_MAX_AMOUNT, this.maxAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapabilitySettings given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java index a506efb74..b903464f9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class CapitalBalance { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_FEE = "fee"; private Long fee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + public static final String JSON_PROPERTY_PRINCIPAL = "principal"; private Long principal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipal = false; + public static final String JSON_PROPERTY_TOTAL = "total"; private Long total; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalBalance() {} /** @@ -49,6 +69,7 @@ public CapitalBalance() {} */ public CapitalBalance currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -76,6 +97,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -86,6 +108,7 @@ public void setCurrency(String currency) { */ public CapitalBalance fee(Long fee) { this.fee = fee; + isSetFee = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Long getFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFee(Long fee) { this.fee = fee; + isSetFee = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setFee(Long fee) { */ public CapitalBalance principal(Long principal) { this.principal = principal; + isSetPrincipal = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Long getPrincipal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrincipal(Long principal) { this.principal = principal; + isSetPrincipal = true; // mark as set } /** @@ -152,6 +178,7 @@ public void setPrincipal(Long principal) { */ public CapitalBalance total(Long total) { this.total = total; + isSetTotal = true; // mark as set return this; } @@ -175,6 +202,27 @@ public Long getTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotal(Long total) { this.total = total; + isSetTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalBalance includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapitalBalance object is equal to o. */ @@ -220,6 +268,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetPrincipal) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL, this.principal); + } + if (isSetTotal) { + addIfNull(nulls, JSON_PROPERTY_TOTAL, this.total); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapitalBalance given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java index 53c3fcdce..bceb98060 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,15 +32,33 @@ public class CapitalGrantAccount { public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID = "fundingBalanceAccountId"; private String fundingBalanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingBalanceAccountId = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LIMITS = "limits"; private List limits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLimits = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalGrantAccount() {} /** @@ -49,6 +69,7 @@ public CapitalGrantAccount() {} */ public CapitalGrantAccount balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -80,6 +101,7 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -91,6 +113,7 @@ public void setBalances(List balances) { */ public CapitalGrantAccount fundingBalanceAccountId(String fundingBalanceAccountId) { this.fundingBalanceAccountId = fundingBalanceAccountId; + isSetFundingBalanceAccountId = true; // mark as set return this; } @@ -116,6 +139,7 @@ public String getFundingBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingBalanceAccountId(String fundingBalanceAccountId) { this.fundingBalanceAccountId = fundingBalanceAccountId; + isSetFundingBalanceAccountId = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setFundingBalanceAccountId(String fundingBalanceAccountId) { */ public CapitalGrantAccount id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -149,6 +174,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -159,6 +185,7 @@ public void setId(String id) { */ public CapitalGrantAccount limits(List limits) { this.limits = limits; + isSetLimits = true; // mark as set return this; } @@ -190,6 +217,27 @@ public List getLimits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLimits(List limits) { this.limits = limits; + isSetLimits = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalGrantAccount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapitalGrantAccount object is equal to o. */ @@ -237,6 +285,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetFundingBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID, this.fundingBalanceAccountId); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLimits) { + addIfNull(nulls, JSON_PROPERTY_LIMITS, this.limits); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapitalGrantAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Card.java b/src/main/java/com/adyen/model/balanceplatform/Card.java index c80794462..4bd1d9c5f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Card.java +++ b/src/main/java/com/adyen/model/balanceplatform/Card.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,30 +44,57 @@ public class Card { public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; private Authentication authentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthentication = false; + public static final String JSON_PROPERTY_BIN = "bin"; private String bin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBin = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; private String brandVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariant = false; + public static final String JSON_PROPERTY_CARDHOLDER_NAME = "cardholderName"; private String cardholderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardholderName = false; + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private CardConfiguration configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + public static final String JSON_PROPERTY_CVC = "cvc"; private String cvc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvc = false; + public static final String JSON_PROPERTY_DELIVERY_CONTACT = "deliveryContact"; private DeliveryContact deliveryContact; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryContact = false; + public static final String JSON_PROPERTY_EXPIRATION = "expiration"; private Expiry expiration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiration = false; + /** The form factor of the card. Possible values: **virtual**, **physical**. */ public enum FormFactorEnum { PHYSICAL(String.valueOf("physical")), @@ -112,18 +141,39 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private FormFactorEnum formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + public static final String JSON_PROPERTY_LAST_FOUR = "lastFour"; private String lastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastFour = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private String threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + public static final String JSON_PROPERTY_USAGE = "usage"; private String usage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUsage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Card() {} @JsonCreator @@ -140,6 +190,7 @@ public Card(@JsonProperty(JSON_PROPERTY_NUMBER) String number) { */ public Card authentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set return this; } @@ -163,6 +214,7 @@ public Authentication getAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set } /** @@ -173,6 +225,7 @@ public void setAuthentication(Authentication authentication) { */ public Card bin(String bin) { this.bin = bin; + isSetBin = true; // mark as set return this; } @@ -196,6 +249,7 @@ public String getBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBin(String bin) { this.bin = bin; + isSetBin = true; // mark as set } /** @@ -206,6 +260,7 @@ public void setBin(String bin) { */ public Card brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -229,6 +284,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -243,6 +299,7 @@ public void setBrand(String brand) { */ public Card brandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set return this; } @@ -274,6 +331,7 @@ public String getBrandVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set } /** @@ -284,6 +342,7 @@ public void setBrandVariant(String brandVariant) { */ public Card cardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set return this; } @@ -307,6 +366,7 @@ public String getCardholderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set } /** @@ -317,6 +377,7 @@ public void setCardholderName(String cardholderName) { */ public Card configuration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -340,6 +401,7 @@ public CardConfiguration getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -352,6 +414,7 @@ public void setConfiguration(CardConfiguration configuration) { */ public Card cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -379,6 +442,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -389,6 +453,7 @@ public void setCvc(String cvc) { */ public Card deliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set return this; } @@ -412,6 +477,7 @@ public DeliveryContact getDeliveryContact() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set } /** @@ -422,6 +488,7 @@ public void setDeliveryContact(DeliveryContact deliveryContact) { */ public Card expiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set return this; } @@ -445,6 +512,7 @@ public Expiry getExpiration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set } /** @@ -455,6 +523,7 @@ public void setExpiration(Expiry expiration) { */ public Card formFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -478,6 +547,7 @@ public FormFactorEnum getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -488,6 +558,7 @@ public void setFormFactor(FormFactorEnum formFactor) { */ public Card lastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set return this; } @@ -511,6 +582,7 @@ public String getLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set } /** @@ -538,6 +610,7 @@ public String getNumber() { */ public Card threeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -569,6 +642,7 @@ public String getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -582,6 +656,7 @@ public void setThreeDSecure(String threeDSecure) { */ public Card usage(String usage) { this.usage = usage; + isSetUsage = true; // mark as set return this; } @@ -611,6 +686,27 @@ public String getUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUsage(String usage) { this.usage = usage; + isSetUsage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Card includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Card object is equal to o. */ @@ -690,6 +786,69 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthentication) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION, this.authentication); + } + if (isSetBin) { + addIfNull(nulls, JSON_PROPERTY_BIN, this.bin); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetBrandVariant) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANT, this.brandVariant); + } + if (isSetCardholderName) { + addIfNull(nulls, JSON_PROPERTY_CARDHOLDER_NAME, this.cardholderName); + } + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetDeliveryContact) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_CONTACT, this.deliveryContact); + } + if (isSetExpiration) { + addIfNull(nulls, JSON_PROPERTY_EXPIRATION, this.expiration); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetLastFour) { + addIfNull(nulls, JSON_PROPERTY_LAST_FOUR, this.lastFour); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetUsage) { + addIfNull(nulls, JSON_PROPERTY_USAGE, this.usage); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Card given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java index d448ec323..5b8b14e10 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,68 +40,117 @@ public class CardConfiguration { public static final String JSON_PROPERTY_ACTIVATION = "activation"; private String activation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActivation = false; + public static final String JSON_PROPERTY_ACTIVATION_URL = "activationUrl"; private String activationUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActivationUrl = false; + public static final String JSON_PROPERTY_BULK_ADDRESS = "bulkAddress"; private BulkAddress bulkAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBulkAddress = false; + public static final String JSON_PROPERTY_CARD_IMAGE_ID = "cardImageId"; private String cardImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardImageId = false; + public static final String JSON_PROPERTY_CARRIER = "carrier"; private String carrier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrier = false; + public static final String JSON_PROPERTY_CARRIER_IMAGE_ID = "carrierImageId"; private String carrierImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierImageId = false; + public static final String JSON_PROPERTY_CONFIGURATION_PROFILE_ID = "configurationProfileId"; private String configurationProfileId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfigurationProfileId = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_ENVELOPE = "envelope"; private String envelope; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvelope = false; + public static final String JSON_PROPERTY_INSERT = "insert"; private String insert; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInsert = false; + public static final String JSON_PROPERTY_LANGUAGE = "language"; private String language; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLanguage = false; + public static final String JSON_PROPERTY_LOGO_IMAGE_ID = "logoImageId"; private String logoImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoImageId = false; + public static final String JSON_PROPERTY_PIN_MAILER = "pinMailer"; private String pinMailer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPinMailer = false; + public static final String JSON_PROPERTY_SHIPMENT_METHOD = "shipmentMethod"; private String shipmentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipmentMethod = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardConfiguration() {} /** - * Overrides the activation label design ID defined in the `configurationProfileId`. The - * activation label is attached to the card and contains the activation instructions. + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. * - * @param activation Overrides the activation label design ID defined in the - * `configurationProfileId`. The activation label is attached to the card and - * contains the activation instructions. + * @param activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration activation(String activation) { this.activation = activation; + isSetActivation = true; // mark as set return this; } /** - * Overrides the activation label design ID defined in the `configurationProfileId`. The - * activation label is attached to the card and contains the activation instructions. + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. * - * @return activation Overrides the activation label design ID defined in the - * `configurationProfileId`. The activation label is attached to the card and - * contains the activation instructions. + * @return activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. */ @JsonProperty(JSON_PROPERTY_ACTIVATION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,17 +159,18 @@ public String getActivation() { } /** - * Overrides the activation label design ID defined in the `configurationProfileId`. The - * activation label is attached to the card and contains the activation instructions. + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. * - * @param activation Overrides the activation label design ID defined in the - * `configurationProfileId`. The activation label is attached to the card and - * contains the activation instructions. + * @param activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. */ @JsonProperty(JSON_PROPERTY_ACTIVATION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setActivation(String activation) { this.activation = activation; + isSetActivation = true; // mark as set } /** @@ -135,6 +187,7 @@ public void setActivation(String activation) { */ public CardConfiguration activationUrl(String activationUrl) { this.activationUrl = activationUrl; + isSetActivationUrl = true; // mark as set return this; } @@ -170,6 +223,7 @@ public String getActivationUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setActivationUrl(String activationUrl) { this.activationUrl = activationUrl; + isSetActivationUrl = true; // mark as set } /** @@ -180,6 +234,7 @@ public void setActivationUrl(String activationUrl) { */ public CardConfiguration bulkAddress(BulkAddress bulkAddress) { this.bulkAddress = bulkAddress; + isSetBulkAddress = true; // mark as set return this; } @@ -203,25 +258,27 @@ public BulkAddress getBulkAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBulkAddress(BulkAddress bulkAddress) { this.bulkAddress = bulkAddress; + isSetBulkAddress = true; // mark as set } /** - * The ID of the card image. This is the image that will be printed on the full front of the card. + * The unique identifier of the card image. This image is printed on the full front of the card. * - * @param cardImageId The ID of the card image. This is the image that will be printed on the full + * @param cardImageId The unique identifier of the card image. This image is printed on the full * front of the card. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration cardImageId(String cardImageId) { this.cardImageId = cardImageId; + isSetCardImageId = true; // mark as set return this; } /** - * The ID of the card image. This is the image that will be printed on the full front of the card. + * The unique identifier of the card image. This image is printed on the full front of the card. * - * @return cardImageId The ID of the card image. This is the image that will be printed on the - * full front of the card. + * @return cardImageId The unique identifier of the card image. This image is printed on the full + * front of the card. */ @JsonProperty(JSON_PROPERTY_CARD_IMAGE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -230,38 +287,38 @@ public String getCardImageId() { } /** - * The ID of the card image. This is the image that will be printed on the full front of the card. + * The unique identifier of the card image. This image is printed on the full front of the card. * - * @param cardImageId The ID of the card image. This is the image that will be printed on the full + * @param cardImageId The unique identifier of the card image. This image is printed on the full * front of the card. */ @JsonProperty(JSON_PROPERTY_CARD_IMAGE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardImageId(String cardImageId) { this.cardImageId = cardImageId; + isSetCardImageId = true; // mark as set } /** - * Overrides the carrier design ID defined in the `configurationProfileId`. The carrier - * is the letter or packaging to which the card is attached. + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. * - * @param carrier Overrides the carrier design ID defined in the - * `configurationProfileId`. The carrier is the letter or packaging to which the - * card is attached. + * @param carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration carrier(String carrier) { this.carrier = carrier; + isSetCarrier = true; // mark as set return this; } /** - * Overrides the carrier design ID defined in the `configurationProfileId`. The carrier - * is the letter or packaging to which the card is attached. + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. * - * @return carrier Overrides the carrier design ID defined in the - * `configurationProfileId`. The carrier is the letter or packaging to which the - * card is attached. + * @return carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CARRIER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -270,37 +327,38 @@ public String getCarrier() { } /** - * Overrides the carrier design ID defined in the `configurationProfileId`. The carrier - * is the letter or packaging to which the card is attached. + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. * - * @param carrier Overrides the carrier design ID defined in the - * `configurationProfileId`. The carrier is the letter or packaging to which the - * card is attached. + * @param carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CARRIER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrier(String carrier) { this.carrier = carrier; + isSetCarrier = true; // mark as set } /** - * The ID of the carrier image. This is the image that will printed on the letter to which the + * The unique identifier of the carrier image. This image is printed on the letter to which the * card is attached. * - * @param carrierImageId The ID of the carrier image. This is the image that will printed on the + * @param carrierImageId The unique identifier of the carrier image. This image is printed on the * letter to which the card is attached. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration carrierImageId(String carrierImageId) { this.carrierImageId = carrierImageId; + isSetCarrierImageId = true; // mark as set return this; } /** - * The ID of the carrier image. This is the image that will printed on the letter to which the + * The unique identifier of the carrier image. This image is printed on the letter to which the * card is attached. * - * @return carrierImageId The ID of the carrier image. This is the image that will printed on the + * @return carrierImageId The unique identifier of the carrier image. This image is printed on the * letter to which the card is attached. */ @JsonProperty(JSON_PROPERTY_CARRIER_IMAGE_ID) @@ -310,51 +368,55 @@ public String getCarrierImageId() { } /** - * The ID of the carrier image. This is the image that will printed on the letter to which the + * The unique identifier of the carrier image. This image is printed on the letter to which the * card is attached. * - * @param carrierImageId The ID of the carrier image. This is the image that will printed on the + * @param carrierImageId The unique identifier of the carrier image. This image is printed on the * letter to which the card is attached. */ @JsonProperty(JSON_PROPERTY_CARRIER_IMAGE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierImageId(String carrierImageId) { this.carrierImageId = carrierImageId; + isSetCarrierImageId = true; // mark as set } /** - * The ID of the card configuration profile that contains the settings of the card. For example, - * the envelope and PIN mailer designs or the logistics company handling the shipment. All the - * settings in the profile are applied to the card, unless you provide other fields to override - * them. For example, send the `shipmentMethod` to override the logistics company - * defined in the card configuration profile. + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. * - * @param configurationProfileId The ID of the card configuration profile that contains the - * settings of the card. For example, the envelope and PIN mailer designs or the logistics - * company handling the shipment. All the settings in the profile are applied to the card, - * unless you provide other fields to override them. For example, send the - * `shipmentMethod` to override the logistics company defined in the card - * configuration profile. + * @param configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration configurationProfileId(String configurationProfileId) { this.configurationProfileId = configurationProfileId; + isSetConfigurationProfileId = true; // mark as set return this; } /** - * The ID of the card configuration profile that contains the settings of the card. For example, - * the envelope and PIN mailer designs or the logistics company handling the shipment. All the - * settings in the profile are applied to the card, unless you provide other fields to override - * them. For example, send the `shipmentMethod` to override the logistics company - * defined in the card configuration profile. + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. * - * @return configurationProfileId The ID of the card configuration profile that contains the - * settings of the card. For example, the envelope and PIN mailer designs or the logistics - * company handling the shipment. All the settings in the profile are applied to the card, - * unless you provide other fields to override them. For example, send the - * `shipmentMethod` to override the logistics company defined in the card - * configuration profile. + * @return configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CONFIGURATION_PROFILE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -363,44 +425,51 @@ public String getConfigurationProfileId() { } /** - * The ID of the card configuration profile that contains the settings of the card. For example, - * the envelope and PIN mailer designs or the logistics company handling the shipment. All the - * settings in the profile are applied to the card, unless you provide other fields to override - * them. For example, send the `shipmentMethod` to override the logistics company - * defined in the card configuration profile. + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. * - * @param configurationProfileId The ID of the card configuration profile that contains the - * settings of the card. For example, the envelope and PIN mailer designs or the logistics - * company handling the shipment. All the settings in the profile are applied to the card, - * unless you provide other fields to override them. For example, send the - * `shipmentMethod` to override the logistics company defined in the card - * configuration profile. + * @param configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CONFIGURATION_PROFILE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfigurationProfileId(String configurationProfileId) { this.configurationProfileId = configurationProfileId; + isSetConfigurationProfileId = true; // mark as set } /** * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. - * For example, **EUR**. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. * * @param currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency - * code of the card. For example, **EUR**. + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } /** * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. - * For example, **EUR**. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. * * @return currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency - * code of the card. For example, **EUR**. + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -410,34 +479,36 @@ public String getCurrency() { /** * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. - * For example, **EUR**. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. * * @param currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency - * code of the card. For example, **EUR**. + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** - * Overrides the envelope design ID defined in the `configurationProfileId`. + * Overrides the envelope design ID defined in the card configuration profile. * - * @param envelope Overrides the envelope design ID defined in the - * `configurationProfileId`. + * @param envelope Overrides the envelope design ID defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration envelope(String envelope) { this.envelope = envelope; + isSetEnvelope = true; // mark as set return this; } /** - * Overrides the envelope design ID defined in the `configurationProfileId`. + * Overrides the envelope design ID defined in the card configuration profile. * - * @return envelope Overrides the envelope design ID defined in the - * `configurationProfileId`. + * @return envelope Overrides the envelope design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_ENVELOPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -446,38 +517,39 @@ public String getEnvelope() { } /** - * Overrides the envelope design ID defined in the `configurationProfileId`. + * Overrides the envelope design ID defined in the card configuration profile. * - * @param envelope Overrides the envelope design ID defined in the - * `configurationProfileId`. + * @param envelope Overrides the envelope design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_ENVELOPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvelope(String envelope) { this.envelope = envelope; + isSetEnvelope = true; // mark as set } /** - * Overrides the insert design ID defined in the `configurationProfileId`. An insert is - * any additional material, such as marketing materials, that are shipped together with the card. + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. * - * @param insert Overrides the insert design ID defined in the `configurationProfileId`. - * An insert is any additional material, such as marketing materials, that are shipped - * together with the card. + * @param insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration insert(String insert) { this.insert = insert; + isSetInsert = true; // mark as set return this; } /** - * Overrides the insert design ID defined in the `configurationProfileId`. An insert is - * any additional material, such as marketing materials, that are shipped together with the card. + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. * - * @return insert Overrides the insert design ID defined in the - * `configurationProfileId`. An insert is any additional material, such as marketing - * materials, that are shipped together with the card. + * @return insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. */ @JsonProperty(JSON_PROPERTY_INSERT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -486,17 +558,18 @@ public String getInsert() { } /** - * Overrides the insert design ID defined in the `configurationProfileId`. An insert is - * any additional material, such as marketing materials, that are shipped together with the card. + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. * - * @param insert Overrides the insert design ID defined in the `configurationProfileId`. - * An insert is any additional material, such as marketing materials, that are shipped - * together with the card. + * @param insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. */ @JsonProperty(JSON_PROPERTY_INSERT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInsert(String insert) { this.insert = insert; + isSetInsert = true; // mark as set } /** @@ -510,6 +583,7 @@ public void setInsert(String insert) { */ public CardConfiguration language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -539,27 +613,29 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** - * The ID of the logo image. This is the image that will be printed on the partial front of the - * card, such as a logo on the upper right corner. + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. * - * @param logoImageId The ID of the logo image. This is the image that will be printed on the - * partial front of the card, such as a logo on the upper right corner. + * @param logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration logoImageId(String logoImageId) { this.logoImageId = logoImageId; + isSetLogoImageId = true; // mark as set return this; } /** - * The ID of the logo image. This is the image that will be printed on the partial front of the - * card, such as a logo on the upper right corner. + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. * - * @return logoImageId The ID of the logo image. This is the image that will be printed on the - * partial front of the card, such as a logo on the upper right corner. + * @return logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. */ @JsonProperty(JSON_PROPERTY_LOGO_IMAGE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -568,39 +644,39 @@ public String getLogoImageId() { } /** - * The ID of the logo image. This is the image that will be printed on the partial front of the - * card, such as a logo on the upper right corner. + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. * - * @param logoImageId The ID of the logo image. This is the image that will be printed on the - * partial front of the card, such as a logo on the upper right corner. + * @param logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. */ @JsonProperty(JSON_PROPERTY_LOGO_IMAGE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLogoImageId(String logoImageId) { this.logoImageId = logoImageId; + isSetLogoImageId = true; // mark as set } /** - * Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN - * mailer is the letter on which the PIN is printed. + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. * - * @param pinMailer Overrides the PIN mailer design ID defined in the - * `configurationProfileId`. The PIN mailer is the letter on which the PIN is - * printed. + * @param pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration pinMailer(String pinMailer) { this.pinMailer = pinMailer; + isSetPinMailer = true; // mark as set return this; } /** - * Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN - * mailer is the letter on which the PIN is printed. + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. * - * @return pinMailer Overrides the PIN mailer design ID defined in the - * `configurationProfileId`. The PIN mailer is the letter on which the PIN is - * printed. + * @return pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_PIN_MAILER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -609,36 +685,39 @@ public String getPinMailer() { } /** - * Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN - * mailer is the letter on which the PIN is printed. + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. * - * @param pinMailer Overrides the PIN mailer design ID defined in the - * `configurationProfileId`. The PIN mailer is the letter on which the PIN is - * printed. + * @param pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_PIN_MAILER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPinMailer(String pinMailer) { this.pinMailer = pinMailer; + isSetPinMailer = true; // mark as set } /** - * Overrides the logistics company defined in the `configurationProfileId`. + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. * - * @param shipmentMethod Overrides the logistics company defined in the - * `configurationProfileId`. + * @param shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration shipmentMethod(String shipmentMethod) { this.shipmentMethod = shipmentMethod; + isSetShipmentMethod = true; // mark as set return this; } /** - * Overrides the logistics company defined in the `configurationProfileId`. + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. * - * @return shipmentMethod Overrides the logistics company defined in the - * `configurationProfileId`. + * @return shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_SHIPMENT_METHOD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -647,15 +726,37 @@ public String getShipmentMethod() { } /** - * Overrides the logistics company defined in the `configurationProfileId`. + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. * - * @param shipmentMethod Overrides the logistics company defined in the - * `configurationProfileId`. + * @param shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_SHIPMENT_METHOD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipmentMethod(String shipmentMethod) { this.shipmentMethod = shipmentMethod; + isSetShipmentMethod = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardConfiguration includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardConfiguration object is equal to o. */ @@ -737,6 +838,69 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetActivation) { + addIfNull(nulls, JSON_PROPERTY_ACTIVATION, this.activation); + } + if (isSetActivationUrl) { + addIfNull(nulls, JSON_PROPERTY_ACTIVATION_URL, this.activationUrl); + } + if (isSetBulkAddress) { + addIfNull(nulls, JSON_PROPERTY_BULK_ADDRESS, this.bulkAddress); + } + if (isSetCardImageId) { + addIfNull(nulls, JSON_PROPERTY_CARD_IMAGE_ID, this.cardImageId); + } + if (isSetCarrier) { + addIfNull(nulls, JSON_PROPERTY_CARRIER, this.carrier); + } + if (isSetCarrierImageId) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_IMAGE_ID, this.carrierImageId); + } + if (isSetConfigurationProfileId) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION_PROFILE_ID, this.configurationProfileId); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetEnvelope) { + addIfNull(nulls, JSON_PROPERTY_ENVELOPE, this.envelope); + } + if (isSetInsert) { + addIfNull(nulls, JSON_PROPERTY_INSERT, this.insert); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetLogoImageId) { + addIfNull(nulls, JSON_PROPERTY_LOGO_IMAGE_ID, this.logoImageId); + } + if (isSetPinMailer) { + addIfNull(nulls, JSON_PROPERTY_PIN_MAILER, this.pinMailer); + } + if (isSetShipmentMethod) { + addIfNull(nulls, JSON_PROPERTY_SHIPMENT_METHOD, this.shipmentMethod); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardConfiguration given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java index 672469bfb..1ac922acf 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,21 +39,39 @@ public class CardInfo { public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; private Authentication authentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthentication = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; private String brandVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariant = false; + public static final String JSON_PROPERTY_CARDHOLDER_NAME = "cardholderName"; private String cardholderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardholderName = false; + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private CardConfiguration configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + public static final String JSON_PROPERTY_DELIVERY_CONTACT = "deliveryContact"; private DeliveryContact deliveryContact; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryContact = false; + /** The form factor of the card. Possible values: **virtual**, **physical**. */ public enum FormFactorEnum { PHYSICAL(String.valueOf("physical")), @@ -98,12 +118,27 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private FormFactorEnum formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private String threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + public static final String JSON_PROPERTY_USAGE = "usage"; private String usage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUsage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardInfo() {} /** @@ -114,6 +149,7 @@ public CardInfo() {} */ public CardInfo authentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set return this; } @@ -137,6 +173,7 @@ public Authentication getAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set } /** @@ -147,6 +184,7 @@ public void setAuthentication(Authentication authentication) { */ public CardInfo brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -170,6 +208,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -184,6 +223,7 @@ public void setBrand(String brand) { */ public CardInfo brandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set return this; } @@ -215,6 +255,7 @@ public String getBrandVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set } /** @@ -225,6 +266,7 @@ public void setBrandVariant(String brandVariant) { */ public CardInfo cardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set return this; } @@ -248,6 +290,7 @@ public String getCardholderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set } /** @@ -258,6 +301,7 @@ public void setCardholderName(String cardholderName) { */ public CardInfo configuration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -281,6 +325,7 @@ public CardConfiguration getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -291,6 +336,7 @@ public void setConfiguration(CardConfiguration configuration) { */ public CardInfo deliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set return this; } @@ -314,6 +360,7 @@ public DeliveryContact getDeliveryContact() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set } /** @@ -324,6 +371,7 @@ public void setDeliveryContact(DeliveryContact deliveryContact) { */ public CardInfo formFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -347,6 +395,7 @@ public FormFactorEnum getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -361,6 +410,7 @@ public void setFormFactor(FormFactorEnum formFactor) { */ public CardInfo threeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -392,6 +442,7 @@ public String getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -405,6 +456,7 @@ public void setThreeDSecure(String threeDSecure) { */ public CardInfo usage(String usage) { this.usage = usage; + isSetUsage = true; // mark as set return this; } @@ -434,6 +486,27 @@ public String getUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUsage(String usage) { this.usage = usage; + isSetUsage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardInfo object is equal to o. */ @@ -498,6 +571,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthentication) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION, this.authentication); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetBrandVariant) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANT, this.brandVariant); + } + if (isSetCardholderName) { + addIfNull(nulls, JSON_PROPERTY_CARDHOLDER_NAME, this.cardholderName); + } + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetDeliveryContact) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_CONTACT, this.deliveryContact); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetUsage) { + addIfNull(nulls, JSON_PROPERTY_USAGE, this.usage); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardOrder.java b/src/main/java/com/adyen/model/balanceplatform/CardOrder.java index 92fc351c6..d7d180119 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardOrder.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardOrder.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,25 +39,46 @@ public class CardOrder { public static final String JSON_PROPERTY_BEGIN_DATE = "beginDate"; private OffsetDateTime beginDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBeginDate = false; + public static final String JSON_PROPERTY_CARD_MANUFACTURING_PROFILE_ID = "cardManufacturingProfileId"; private String cardManufacturingProfileId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardManufacturingProfileId = false; + public static final String JSON_PROPERTY_CLOSED_DATE = "closedDate"; private OffsetDateTime closedDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClosedDate = false; + public static final String JSON_PROPERTY_END_DATE = "endDate"; private OffsetDateTime endDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LOCK_DATE = "lockDate"; private OffsetDateTime lockDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLockDate = false; + public static final String JSON_PROPERTY_SERVICE_CENTER = "serviceCenter"; private String serviceCenter; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetServiceCenter = false; + /** The status of the card order. Possible values: **Open**, **Closed**. */ public enum StatusEnum { CLOSED(String.valueOf("closed")), @@ -100,6 +123,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardOrder() {} /** @@ -110,6 +142,7 @@ public CardOrder() {} */ public CardOrder beginDate(OffsetDateTime beginDate) { this.beginDate = beginDate; + isSetBeginDate = true; // mark as set return this; } @@ -133,6 +166,7 @@ public OffsetDateTime getBeginDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBeginDate(OffsetDateTime beginDate) { this.beginDate = beginDate; + isSetBeginDate = true; // mark as set } /** @@ -143,6 +177,7 @@ public void setBeginDate(OffsetDateTime beginDate) { */ public CardOrder cardManufacturingProfileId(String cardManufacturingProfileId) { this.cardManufacturingProfileId = cardManufacturingProfileId; + isSetCardManufacturingProfileId = true; // mark as set return this; } @@ -166,6 +201,7 @@ public String getCardManufacturingProfileId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardManufacturingProfileId(String cardManufacturingProfileId) { this.cardManufacturingProfileId = cardManufacturingProfileId; + isSetCardManufacturingProfileId = true; // mark as set } /** @@ -176,6 +212,7 @@ public void setCardManufacturingProfileId(String cardManufacturingProfileId) { */ public CardOrder closedDate(OffsetDateTime closedDate) { this.closedDate = closedDate; + isSetClosedDate = true; // mark as set return this; } @@ -199,6 +236,7 @@ public OffsetDateTime getClosedDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClosedDate(OffsetDateTime closedDate) { this.closedDate = closedDate; + isSetClosedDate = true; // mark as set } /** @@ -213,6 +251,7 @@ public void setClosedDate(OffsetDateTime closedDate) { */ public CardOrder endDate(OffsetDateTime endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set return this; } @@ -244,6 +283,7 @@ public OffsetDateTime getEndDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndDate(OffsetDateTime endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set } /** @@ -254,6 +294,7 @@ public void setEndDate(OffsetDateTime endDate) { */ public CardOrder id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -277,6 +318,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -287,6 +329,7 @@ public void setId(String id) { */ public CardOrder lockDate(OffsetDateTime lockDate) { this.lockDate = lockDate; + isSetLockDate = true; // mark as set return this; } @@ -310,6 +353,7 @@ public OffsetDateTime getLockDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLockDate(OffsetDateTime lockDate) { this.lockDate = lockDate; + isSetLockDate = true; // mark as set } /** @@ -320,6 +364,7 @@ public void setLockDate(OffsetDateTime lockDate) { */ public CardOrder serviceCenter(String serviceCenter) { this.serviceCenter = serviceCenter; + isSetServiceCenter = true; // mark as set return this; } @@ -343,6 +388,7 @@ public String getServiceCenter() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setServiceCenter(String serviceCenter) { this.serviceCenter = serviceCenter; + isSetServiceCenter = true; // mark as set } /** @@ -353,6 +399,7 @@ public void setServiceCenter(String serviceCenter) { */ public CardOrder status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -376,6 +423,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardOrder includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardOrder object is equal to o. */ @@ -439,6 +507,52 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBeginDate) { + addIfNull(nulls, JSON_PROPERTY_BEGIN_DATE, this.beginDate); + } + if (isSetCardManufacturingProfileId) { + addIfNull( + nulls, JSON_PROPERTY_CARD_MANUFACTURING_PROFILE_ID, this.cardManufacturingProfileId); + } + if (isSetClosedDate) { + addIfNull(nulls, JSON_PROPERTY_CLOSED_DATE, this.closedDate); + } + if (isSetEndDate) { + addIfNull(nulls, JSON_PROPERTY_END_DATE, this.endDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLockDate) { + addIfNull(nulls, JSON_PROPERTY_LOCK_DATE, this.lockDate); + } + if (isSetServiceCenter) { + addIfNull(nulls, JSON_PROPERTY_SERVICE_CENTER, this.serviceCenter); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardOrder given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardOrderItem.java b/src/main/java/com/adyen/model/balanceplatform/CardOrderItem.java index 94ea7a405..97e508b95 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardOrderItem.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardOrderItem.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,27 +36,57 @@ public class CardOrderItem { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CARD = "card"; private CardOrderItemDeliveryStatus card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_CARD_ORDER_ITEM_ID = "cardOrderItemId"; private String cardOrderItemId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardOrderItemId = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_PIN = "pin"; private CardOrderItemDeliveryStatus pin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPin = false; + public static final String JSON_PROPERTY_SHIPPING_METHOD = "shippingMethod"; private String shippingMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShippingMethod = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardOrderItem() {} @JsonCreator @@ -71,6 +103,7 @@ public CardOrderItem(@JsonProperty(JSON_PROPERTY_ID) String id) { */ public CardOrderItem balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -94,6 +127,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -104,6 +138,7 @@ public void setBalancePlatform(String balancePlatform) { */ public CardOrderItem card(CardOrderItemDeliveryStatus card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -127,6 +162,7 @@ public CardOrderItemDeliveryStatus getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(CardOrderItemDeliveryStatus card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -137,6 +173,7 @@ public void setCard(CardOrderItemDeliveryStatus card) { */ public CardOrderItem cardOrderItemId(String cardOrderItemId) { this.cardOrderItemId = cardOrderItemId; + isSetCardOrderItemId = true; // mark as set return this; } @@ -160,6 +197,7 @@ public String getCardOrderItemId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardOrderItemId(String cardOrderItemId) { this.cardOrderItemId = cardOrderItemId; + isSetCardOrderItemId = true; // mark as set } /** @@ -172,6 +210,7 @@ public void setCardOrderItemId(String cardOrderItemId) { */ public CardOrderItem creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -199,6 +238,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -221,6 +261,7 @@ public String getId() { */ public CardOrderItem paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -246,6 +287,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -256,6 +298,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public CardOrderItem pin(CardOrderItemDeliveryStatus pin) { this.pin = pin; + isSetPin = true; // mark as set return this; } @@ -279,6 +322,7 @@ public CardOrderItemDeliveryStatus getPin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPin(CardOrderItemDeliveryStatus pin) { this.pin = pin; + isSetPin = true; // mark as set } /** @@ -289,6 +333,7 @@ public void setPin(CardOrderItemDeliveryStatus pin) { */ public CardOrderItem shippingMethod(String shippingMethod) { this.shippingMethod = shippingMethod; + isSetShippingMethod = true; // mark as set return this; } @@ -312,6 +357,27 @@ public String getShippingMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShippingMethod(String shippingMethod) { this.shippingMethod = shippingMethod; + isSetShippingMethod = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardOrderItem includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardOrderItem object is equal to o. */ @@ -375,6 +441,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetCardOrderItemId) { + addIfNull(nulls, JSON_PROPERTY_CARD_ORDER_ITEM_ID, this.cardOrderItemId); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetPin) { + addIfNull(nulls, JSON_PROPERTY_PIN, this.pin); + } + if (isSetShippingMethod) { + addIfNull(nulls, JSON_PROPERTY_SHIPPING_METHOD, this.shippingMethod); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardOrderItem given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardOrderItemDeliveryStatus.java b/src/main/java/com/adyen/model/balanceplatform/CardOrderItemDeliveryStatus.java index 325c4e3e2..b8ff2cd97 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardOrderItemDeliveryStatus.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardOrderItemDeliveryStatus.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class CardOrderItemDeliveryStatus { public static final String JSON_PROPERTY_ERROR_MESSAGE = "errorMessage"; private String errorMessage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorMessage = false; + /** The status of the PIN delivery. */ public enum StatusEnum { CREATED(String.valueOf("created")), @@ -87,9 +92,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TRACKING_NUMBER = "trackingNumber"; private String trackingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackingNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardOrderItemDeliveryStatus() {} /** @@ -100,6 +117,7 @@ public CardOrderItemDeliveryStatus() {} */ public CardOrderItemDeliveryStatus errorMessage(String errorMessage) { this.errorMessage = errorMessage; + isSetErrorMessage = true; // mark as set return this; } @@ -123,6 +141,7 @@ public String getErrorMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; + isSetErrorMessage = true; // mark as set } /** @@ -133,6 +152,7 @@ public void setErrorMessage(String errorMessage) { */ public CardOrderItemDeliveryStatus status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -156,6 +176,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -166,6 +187,7 @@ public void setStatus(StatusEnum status) { */ public CardOrderItemDeliveryStatus trackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; + isSetTrackingNumber = true; // mark as set return this; } @@ -189,6 +211,27 @@ public String getTrackingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; + isSetTrackingNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardOrderItemDeliveryStatus includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardOrderItemDeliveryStatus object is equal to o. */ @@ -232,6 +275,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetErrorMessage) { + addIfNull(nulls, JSON_PROPERTY_ERROR_MESSAGE, this.errorMessage); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTrackingNumber) { + addIfNull(nulls, JSON_PROPERTY_TRACKING_NUMBER, this.trackingNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardOrderItemDeliveryStatus given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Condition.java b/src/main/java/com/adyen/model/balanceplatform/Condition.java index 413cfa8b5..2accbbad8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Condition.java +++ b/src/main/java/com/adyen/model/balanceplatform/Condition.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -81,6 +83,9 @@ public static BalanceTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_BALANCE_TYPE = "balanceType"; private BalanceTypeEnum balanceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceType = false; + /** * Define when you want to get notified about a balance change. Possible values: * * **greaterThan**: the balance in the account(s) exceeds the specified `value`. * @@ -136,9 +141,21 @@ public static ConditionTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_CONDITION_TYPE = "conditionType"; private ConditionTypeEnum conditionType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConditionType = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Long value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Condition() {} /** @@ -155,6 +172,7 @@ public Condition() {} */ public Condition balanceType(BalanceTypeEnum balanceType) { this.balanceType = balanceType; + isSetBalanceType = true; // mark as set return this; } @@ -190,6 +208,7 @@ public BalanceTypeEnum getBalanceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceType(BalanceTypeEnum balanceType) { this.balanceType = balanceType; + isSetBalanceType = true; // mark as set } /** @@ -210,6 +229,7 @@ public void setBalanceType(BalanceTypeEnum balanceType) { */ public Condition conditionType(ConditionTypeEnum conditionType) { this.conditionType = conditionType; + isSetConditionType = true; // mark as set return this; } @@ -253,6 +273,7 @@ public ConditionTypeEnum getConditionType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConditionType(ConditionTypeEnum conditionType) { this.conditionType = conditionType; + isSetConditionType = true; // mark as set } /** @@ -263,6 +284,7 @@ public void setConditionType(ConditionTypeEnum conditionType) { */ public Condition value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -286,6 +308,27 @@ public Long getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Condition includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Condition object is equal to o. */ @@ -329,6 +372,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceType) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_TYPE, this.balanceType); + } + if (isSetConditionType) { + addIfNull(nulls, JSON_PROPERTY_CONDITION_TYPE, this.conditionType); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Condition given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java b/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java index fcfef740d..4915dffae 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java +++ b/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,33 @@ public class ContactDetails { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_PHONE = "phone"; private Phone phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + public static final String JSON_PROPERTY_WEB_ADDRESS = "webAddress"; private String webAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ContactDetails() {} /** @@ -52,6 +72,7 @@ public ContactDetails() {} */ public ContactDetails address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -75,6 +96,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -85,6 +107,7 @@ public void setAddress(Address address) { */ public ContactDetails email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -108,6 +131,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -118,6 +142,7 @@ public void setEmail(String email) { */ public ContactDetails phone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -141,6 +166,7 @@ public Phone getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set } /** @@ -151,6 +177,7 @@ public void setPhone(Phone phone) { */ public ContactDetails webAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set return this; } @@ -174,6 +201,27 @@ public String getWebAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ContactDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ContactDetails object is equal to o. */ @@ -219,6 +267,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + if (isSetWebAddress) { + addIfNull(nulls, JSON_PROPERTY_WEB_ADDRESS, this.webAddress); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ContactDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Counterparty.java b/src/main/java/com/adyen/model/balanceplatform/Counterparty.java index 9cf7780d1..6b4675d68 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Counterparty.java +++ b/src/main/java/com/adyen/model/balanceplatform/Counterparty.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class Counterparty { public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccount bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Counterparty() {} /** @@ -39,6 +53,7 @@ public Counterparty() {} */ public Counterparty bankAccount(BankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -62,6 +77,7 @@ public BankAccount getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setBankAccount(BankAccount bankAccount) { */ public Counterparty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -101,6 +118,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Counterparty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Counterparty object is equal to o. */ @@ -144,6 +182,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Counterparty given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CounterpartyBankRestriction.java b/src/main/java/com/adyen/model/balanceplatform/CounterpartyBankRestriction.java index e42dbdcd9..6de217133 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CounterpartyBankRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/CounterpartyBankRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class CounterpartyBankRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyBankRestriction() {} /** @@ -41,6 +55,7 @@ public CounterpartyBankRestriction() {} */ public CounterpartyBankRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public CounterpartyBankRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyBankRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CounterpartyBankRestriction object is equal to o. */ @@ -146,6 +184,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CounterpartyBankRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CounterpartyTypesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/CounterpartyTypesRestriction.java index 19e5a61a3..3a4759d98 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CounterpartyTypesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/CounterpartyTypesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class CounterpartyTypesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { BALANCEACCOUNT(String.valueOf("balanceAccount")), @@ -80,6 +85,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyTypesRestriction() {} /** @@ -90,6 +104,7 @@ public CounterpartyTypesRestriction() {} */ public CounterpartyTypesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -113,6 +128,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setOperation(String operation) { */ public CounterpartyTypesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -154,6 +171,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyTypesRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CounterpartyTypesRestriction object is equal to o. */ @@ -195,6 +233,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CounterpartyTypesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java index 78d780e09..05ff35460 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class CountriesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CountriesRestriction() {} /** @@ -41,6 +55,7 @@ public CountriesRestriction() {} */ public CountriesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -76,6 +92,7 @@ public void setOperation(String operation) { */ public CountriesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -111,6 +128,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CountriesRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CountriesRestriction object is equal to o. */ @@ -152,6 +190,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CountriesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CreateScaInformation.java b/src/main/java/com/adyen/model/balanceplatform/CreateScaInformation.java index d0aeb7744..cae976e2d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CreateScaInformation.java +++ b/src/main/java/com/adyen/model/balanceplatform/CreateScaInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class CreateScaInformation { public static final String JSON_PROPERTY_EXEMPTION = "exemption"; private ScaExemption exemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExemption = false; + public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private Boolean scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateScaInformation() {} /** @@ -39,6 +53,7 @@ public CreateScaInformation() {} */ public CreateScaInformation exemption(ScaExemption exemption) { this.exemption = exemption; + isSetExemption = true; // mark as set return this; } @@ -62,6 +77,7 @@ public ScaExemption getExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemption(ScaExemption exemption) { this.exemption = exemption; + isSetExemption = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setExemption(ScaExemption exemption) { */ public CreateScaInformation scaOnApproval(Boolean scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -113,6 +130,27 @@ public Boolean getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(Boolean scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateScaInformation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CreateScaInformation object is equal to o. */ @@ -154,6 +192,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExemption) { + addIfNull(nulls, JSON_PROPERTY_EXEMPTION, this.exemption); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CreateScaInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java index 216b62e90..de6fceb5c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -95,15 +97,27 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private SweepCounterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -156,6 +170,9 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** The reason for disabling the sweep. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -205,6 +222,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -247,18 +266,33 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REASON_DETAIL = "reasonDetail"; private String reasonDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReasonDetail = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; private SweepSchedule schedule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + /** * The status of the sweep. If not provided, by default, this is set to **active**. Possible * values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on @@ -307,15 +341,27 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_SWEEP_AMOUNT = "sweepAmount"; private Amount sweepAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweepAmount = false; + public static final String JSON_PROPERTY_TARGET_AMOUNT = "targetAmount"; private Amount targetAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAmount = false; + public static final String JSON_PROPERTY_TRIGGER_AMOUNT = "triggerAmount"; private Amount triggerAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggerAmount = false; + /** * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not * provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to @@ -365,6 +411,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateSweepConfigurationV2() {} @JsonCreator @@ -394,6 +449,7 @@ public CreateSweepConfigurationV2( */ public CreateSweepConfigurationV2 category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -437,6 +493,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -447,6 +504,7 @@ public void setCategory(CategoryEnum category) { */ public CreateSweepConfigurationV2 counterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -470,6 +528,7 @@ public SweepCounterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -486,6 +545,7 @@ public void setCounterparty(SweepCounterparty counterparty) { */ public CreateSweepConfigurationV2 currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -521,6 +581,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -535,6 +596,7 @@ public void setCurrency(String currency) { */ public CreateSweepConfigurationV2 description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -566,6 +628,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -577,14 +640,14 @@ public void setDescription(String description) { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -600,14 +663,14 @@ public void setDescription(String description) { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -617,6 +680,7 @@ public void setDescription(String description) { */ public CreateSweepConfigurationV2 priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -637,14 +701,14 @@ public CreateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesIte * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -660,14 +724,14 @@ public CreateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesIte * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -689,14 +753,14 @@ public List getPriorities() { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -712,14 +776,14 @@ public List getPriorities() { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -730,6 +794,7 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** @@ -762,6 +827,7 @@ public String getReasonDetail() { */ public CreateSweepConfigurationV2 reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -785,6 +851,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -797,6 +864,7 @@ public void setReference(String reference) { */ public CreateSweepConfigurationV2 referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -824,6 +892,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -834,6 +903,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public CreateSweepConfigurationV2 schedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set return this; } @@ -857,6 +927,7 @@ public SweepSchedule getSchedule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set } /** @@ -872,6 +943,7 @@ public void setSchedule(SweepSchedule schedule) { */ public CreateSweepConfigurationV2 status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -905,6 +977,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -915,6 +988,7 @@ public void setStatus(StatusEnum status) { */ public CreateSweepConfigurationV2 sweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set return this; } @@ -938,6 +1012,7 @@ public Amount getSweepAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set } /** @@ -948,6 +1023,7 @@ public void setSweepAmount(Amount sweepAmount) { */ public CreateSweepConfigurationV2 targetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set return this; } @@ -971,6 +1047,7 @@ public Amount getTargetAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set } /** @@ -981,6 +1058,7 @@ public void setTargetAmount(Amount targetAmount) { */ public CreateSweepConfigurationV2 triggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set return this; } @@ -1004,6 +1082,7 @@ public Amount getTriggerAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTriggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set } /** @@ -1020,6 +1099,7 @@ public void setTriggerAmount(Amount triggerAmount) { */ public CreateSweepConfigurationV2 type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1055,6 +1135,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateSweepConfigurationV2 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CreateSweepConfigurationV2 object is equal to o. */ @@ -1140,6 +1241,72 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReasonDetail) { + addIfNull(nulls, JSON_PROPERTY_REASON_DETAIL, this.reasonDetail); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSweepAmount) { + addIfNull(nulls, JSON_PROPERTY_SWEEP_AMOUNT, this.sweepAmount); + } + if (isSetTargetAmount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_AMOUNT, this.targetAmount); + } + if (isSetTriggerAmount) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER_AMOUNT, this.triggerAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CreateSweepConfigurationV2 given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CreateTransferLimitRequest.java b/src/main/java/com/adyen/model/balanceplatform/CreateTransferLimitRequest.java index daa5c4b86..186c8f61f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CreateTransferLimitRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/CreateTransferLimitRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,24 +34,51 @@ public class CreateTransferLimitRequest { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; private OffsetDateTime endsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndsAt = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SCA_INFORMATION = "scaInformation"; private CreateScaInformation scaInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaInformation = false; + public static final String JSON_PROPERTY_SCOPE = "scope"; private Scope scope; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScope = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private OffsetDateTime startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + public static final String JSON_PROPERTY_TRANSFER_TYPE = "transferType"; private TransferType transferType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateTransferLimitRequest() {} /** @@ -60,6 +89,7 @@ public CreateTransferLimitRequest() {} */ public CreateTransferLimitRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -83,6 +113,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -97,6 +128,7 @@ public void setAmount(Amount amount) { */ public CreateTransferLimitRequest endsAt(OffsetDateTime endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -128,6 +160,7 @@ public OffsetDateTime getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(OffsetDateTime endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -138,6 +171,7 @@ public void setEndsAt(OffsetDateTime endsAt) { */ public CreateTransferLimitRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -161,6 +195,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -171,6 +206,7 @@ public void setReference(String reference) { */ public CreateTransferLimitRequest scaInformation(CreateScaInformation scaInformation) { this.scaInformation = scaInformation; + isSetScaInformation = true; // mark as set return this; } @@ -194,6 +230,7 @@ public CreateScaInformation getScaInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaInformation(CreateScaInformation scaInformation) { this.scaInformation = scaInformation; + isSetScaInformation = true; // mark as set } /** @@ -204,6 +241,7 @@ public void setScaInformation(CreateScaInformation scaInformation) { */ public CreateTransferLimitRequest scope(Scope scope) { this.scope = scope; + isSetScope = true; // mark as set return this; } @@ -227,6 +265,7 @@ public Scope getScope() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScope(Scope scope) { this.scope = scope; + isSetScope = true; // mark as set } /** @@ -241,6 +280,7 @@ public void setScope(Scope scope) { */ public CreateTransferLimitRequest startsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -272,6 +312,7 @@ public OffsetDateTime getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set } /** @@ -282,6 +323,7 @@ public void setStartsAt(OffsetDateTime startsAt) { */ public CreateTransferLimitRequest transferType(TransferType transferType) { this.transferType = transferType; + isSetTransferType = true; // mark as set return this; } @@ -305,6 +347,27 @@ public TransferType getTransferType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferType(TransferType transferType) { this.transferType = transferType; + isSetTransferType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateTransferLimitRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CreateTransferLimitRequest object is equal to o. */ @@ -356,6 +419,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScaInformation) { + addIfNull(nulls, JSON_PROPERTY_SCA_INFORMATION, this.scaInformation); + } + if (isSetScope) { + addIfNull(nulls, JSON_PROPERTY_SCOPE, this.scope); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + if (isSetTransferType) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_TYPE, this.transferType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CreateTransferLimitRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java index d71699bac..5c01a9866 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class DKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **dkLocal** */ public enum TypeEnum { DKLOCAL(String.valueOf("dkLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DKLocalAccountIdentification() {} /** @@ -87,6 +104,7 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -112,6 +130,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DKLocalAccountIdentification object is equal to o. */ @@ -222,6 +265,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java index 175e26def..c8a6ab296 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class DayOfWeekRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { FRIDAY(String.valueOf("friday")), @@ -86,6 +91,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DayOfWeekRestriction() {} /** @@ -96,6 +110,7 @@ public DayOfWeekRestriction() {} */ public DayOfWeekRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -119,6 +134,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -131,6 +147,7 @@ public void setOperation(String operation) { */ public DayOfWeekRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -166,6 +183,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DayOfWeekRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DayOfWeekRestriction object is equal to o. */ @@ -207,6 +245,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DayOfWeekRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/balanceplatform/DefaultErrorResponseEntity.java index a83760921..24d7d61d8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DefaultErrorResponseEntity.java +++ b/src/main/java/com/adyen/model/balanceplatform/DefaultErrorResponseEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,27 +36,57 @@ public class DefaultErrorResponseEntity { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + public static final String JSON_PROPERTY_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefaultErrorResponseEntity() {} /** @@ -65,6 +97,7 @@ public DefaultErrorResponseEntity() {} */ public DefaultErrorResponseEntity detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -88,6 +121,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -98,6 +132,7 @@ public void setDetail(String detail) { */ public DefaultErrorResponseEntity errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -121,6 +156,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -131,6 +167,7 @@ public void setErrorCode(String errorCode) { */ public DefaultErrorResponseEntity instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -154,6 +191,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -164,6 +202,7 @@ public void setInstance(String instance) { */ public DefaultErrorResponseEntity invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -195,6 +234,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -205,6 +245,7 @@ public void setInvalidFields(List invalidFields) { */ public DefaultErrorResponseEntity requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -228,6 +269,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -238,6 +280,7 @@ public void setRequestId(String requestId) { */ public DefaultErrorResponseEntity status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +304,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -271,6 +315,7 @@ public void setStatus(Integer status) { */ public DefaultErrorResponseEntity title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -294,6 +339,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -306,6 +352,7 @@ public void setTitle(String title) { */ public DefaultErrorResponseEntity type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -333,6 +380,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DefaultErrorResponseEntity object is equal to o. */ @@ -386,6 +454,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DefaultErrorResponseEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DelegatedAuthenticationData.java b/src/main/java/com/adyen/model/balanceplatform/DelegatedAuthenticationData.java index eea5efe3a..c4a64cb49 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DelegatedAuthenticationData.java +++ b/src/main/java/com/adyen/model/balanceplatform/DelegatedAuthenticationData.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class DelegatedAuthenticationData { public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DelegatedAuthenticationData() {} /** @@ -35,6 +46,7 @@ public DelegatedAuthenticationData() {} */ public DelegatedAuthenticationData sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -62,6 +74,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DelegatedAuthenticationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DelegatedAuthenticationData object is equal to o. */ @@ -101,6 +134,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DelegatedAuthenticationData given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java index a83f678b9..eb9f329fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,24 +33,51 @@ public class DeliveryAddress { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_LINE3 = "line3"; private String line3; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine3 = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeliveryAddress() {} /** @@ -59,6 +88,7 @@ public DeliveryAddress() {} */ public DeliveryAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -82,6 +112,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -96,6 +127,7 @@ public void setCity(String city) { */ public DeliveryAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -127,6 +159,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -139,6 +172,7 @@ public void setCountry(String country) { */ public DeliveryAddress line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -166,6 +200,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -178,6 +213,7 @@ public void setLine1(String line1) { */ public DeliveryAddress line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -205,6 +241,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -215,6 +252,7 @@ public void setLine2(String line2) { */ public DeliveryAddress line3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set return this; } @@ -238,6 +276,7 @@ public String getLine3() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set } /** @@ -250,6 +289,7 @@ public void setLine3(String line3) { */ public DeliveryAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -277,6 +317,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -290,6 +331,7 @@ public void setPostalCode(String postalCode) { */ public DeliveryAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -319,6 +361,27 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeliveryAddress includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DeliveryAddress object is equal to o. */ @@ -370,6 +433,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetLine3) { + addIfNull(nulls, JSON_PROPERTY_LINE3, this.line3); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DeliveryAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java index 2060508f9..15d48967b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,24 +33,51 @@ public class DeliveryContact { public static final String JSON_PROPERTY_ADDRESS = "address"; private DeliveryAddress address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private String company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_FULL_PHONE_NUMBER = "fullPhoneNumber"; private String fullPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullPhoneNumber = false; + public static final String JSON_PROPERTY_NAME = "name"; private Name name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private PhoneNumber phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + public static final String JSON_PROPERTY_WEB_ADDRESS = "webAddress"; private String webAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeliveryContact() {} /** @@ -59,6 +88,7 @@ public DeliveryContact() {} */ public DeliveryContact address(DeliveryAddress address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -82,6 +112,7 @@ public DeliveryAddress getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(DeliveryAddress address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -92,6 +123,7 @@ public void setAddress(DeliveryAddress address) { */ public DeliveryContact company(String company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -115,6 +147,7 @@ public String getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(String company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -125,6 +158,7 @@ public void setCompany(String company) { */ public DeliveryContact email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -148,6 +182,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -162,6 +197,7 @@ public void setEmail(String email) { */ public DeliveryContact fullPhoneNumber(String fullPhoneNumber) { this.fullPhoneNumber = fullPhoneNumber; + isSetFullPhoneNumber = true; // mark as set return this; } @@ -193,6 +229,7 @@ public String getFullPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullPhoneNumber(String fullPhoneNumber) { this.fullPhoneNumber = fullPhoneNumber; + isSetFullPhoneNumber = true; // mark as set } /** @@ -203,6 +240,7 @@ public void setFullPhoneNumber(String fullPhoneNumber) { */ public DeliveryContact name(Name name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -226,6 +264,7 @@ public Name getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(Name name) { this.name = name; + isSetName = true; // mark as set } /** @@ -236,6 +275,7 @@ public void setName(Name name) { */ public DeliveryContact phoneNumber(PhoneNumber phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -259,6 +299,7 @@ public PhoneNumber getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(PhoneNumber phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -269,6 +310,7 @@ public void setPhoneNumber(PhoneNumber phoneNumber) { */ public DeliveryContact webAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set return this; } @@ -292,6 +334,27 @@ public String getWebAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeliveryContact includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DeliveryContact object is equal to o. */ @@ -343,6 +406,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFullPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_FULL_PHONE_NUMBER, this.fullPhoneNumber); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetWebAddress) { + addIfNull(nulls, JSON_PROPERTY_WEB_ADDRESS, this.webAddress); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DeliveryContact given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Device.java b/src/main/java/com/adyen/model/balanceplatform/Device.java index 6ccc17a0d..e124486c0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Device.java +++ b/src/main/java/com/adyen/model/balanceplatform/Device.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,12 +34,21 @@ public class Device { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + /** The type of device. Possible values: **ios**, **android**, **browser**. */ public enum TypeEnum { IOS(String.valueOf("ios")), @@ -84,6 +95,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Device() {} /** @@ -94,6 +114,7 @@ public Device() {} */ public Device id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -117,6 +138,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -129,6 +151,7 @@ public void setId(String id) { */ public Device name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -156,6 +179,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -167,6 +191,7 @@ public void setName(String name) { */ public Device paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -192,6 +217,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public Device type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Device includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Device object is equal to o. */ @@ -272,6 +320,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Device given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java b/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java index 720a344a6..a44cec78d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java @@ -11,145 +11,53 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.core.JsonProcessingException; import java.util.*; -import java.util.ArrayList; -import java.util.List; /** DeviceInfo */ -@JsonPropertyOrder({ - DeviceInfo.JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY, - DeviceInfo.JSON_PROPERTY_DEVICE_NAME, - DeviceInfo.JSON_PROPERTY_FORM_FACTOR, - DeviceInfo.JSON_PROPERTY_IMEI, - DeviceInfo.JSON_PROPERTY_ISO_DEVICE_TYPE, - DeviceInfo.JSON_PROPERTY_MSISDN, - DeviceInfo.JSON_PROPERTY_OS_NAME, - DeviceInfo.JSON_PROPERTY_OS_VERSION, - DeviceInfo.JSON_PROPERTY_PAYMENT_TYPES, - DeviceInfo.JSON_PROPERTY_SERIAL_NUMBER, - DeviceInfo.JSON_PROPERTY_STORAGE_TECHNOLOGY -}) +@JsonPropertyOrder({DeviceInfo.JSON_PROPERTY_FORM_FACTOR, DeviceInfo.JSON_PROPERTY_OS_NAME}) public class DeviceInfo { - public static final String JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY = "cardCaptureTechnology"; - private String cardCaptureTechnology; - - public static final String JSON_PROPERTY_DEVICE_NAME = "deviceName"; - private String deviceName; - public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private String formFactor; - public static final String JSON_PROPERTY_IMEI = "imei"; - private String imei; - - public static final String JSON_PROPERTY_ISO_DEVICE_TYPE = "isoDeviceType"; - private String isoDeviceType; - - public static final String JSON_PROPERTY_MSISDN = "msisdn"; - private String msisdn; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; public static final String JSON_PROPERTY_OS_NAME = "osName"; private String osName; - public static final String JSON_PROPERTY_OS_VERSION = "osVersion"; - private String osVersion; - - public static final String JSON_PROPERTY_PAYMENT_TYPES = "paymentTypes"; - private List paymentTypes; - - public static final String JSON_PROPERTY_SERIAL_NUMBER = "serialNumber"; - private String serialNumber; - - public static final String JSON_PROPERTY_STORAGE_TECHNOLOGY = "storageTechnology"; - private String storageTechnology; - - public DeviceInfo() {} - - /** - * The technology used to capture the card details. - * - * @param cardCaptureTechnology The technology used to capture the card details. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo cardCaptureTechnology(String cardCaptureTechnology) { - this.cardCaptureTechnology = cardCaptureTechnology; - return this; - } - - /** - * The technology used to capture the card details. - * - * @return cardCaptureTechnology The technology used to capture the card details. - */ - @JsonProperty(JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCardCaptureTechnology() { - return cardCaptureTechnology; - } - - /** - * The technology used to capture the card details. - * - * @param cardCaptureTechnology The technology used to capture the card details. - */ - @JsonProperty(JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCardCaptureTechnology(String cardCaptureTechnology) { - this.cardCaptureTechnology = cardCaptureTechnology; - } + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOsName = false; /** - * The name of the device. - * - * @param deviceName The name of the device. - * @return the current {@code DeviceInfo} instance, allowing for method chaining + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. */ - public DeviceInfo deviceName(String deviceName) { - this.deviceName = deviceName; - return this; - } + @JsonIgnore private boolean includeNullValues = false; - /** - * The name of the device. - * - * @return deviceName The name of the device. - */ - @JsonProperty(JSON_PROPERTY_DEVICE_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDeviceName() { - return deviceName; - } - - /** - * The name of the device. - * - * @param deviceName The name of the device. - */ - @JsonProperty(JSON_PROPERTY_DEVICE_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeviceName(String deviceName) { - this.deviceName = deviceName; - } + public DeviceInfo() {} /** - * The form factor of the device to be provisioned. + * The type of device used to provision the network token. * - * @param formFactor The form factor of the device to be provisioned. + * @param formFactor The type of device used to provision the network token. * @return the current {@code DeviceInfo} instance, allowing for method chaining */ public DeviceInfo formFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } /** - * The form factor of the device to be provisioned. + * The type of device used to provision the network token. * - * @return formFactor The form factor of the device to be provisioned. + * @return formFactor The type of device used to provision the network token. */ @JsonProperty(JSON_PROPERTY_FORM_FACTOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,133 +66,33 @@ public String getFormFactor() { } /** - * The form factor of the device to be provisioned. + * The type of device used to provision the network token. * - * @param formFactor The form factor of the device to be provisioned. + * @param formFactor The type of device used to provision the network token. */ @JsonProperty(JSON_PROPERTY_FORM_FACTOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** - * The IMEI number of the device being provisioned. + * The operating system of the device used to provision the network token. * - * @param imei The IMEI number of the device being provisioned. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo imei(String imei) { - this.imei = imei; - return this; - } - - /** - * The IMEI number of the device being provisioned. - * - * @return imei The IMEI number of the device being provisioned. - */ - @JsonProperty(JSON_PROPERTY_IMEI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getImei() { - return imei; - } - - /** - * The IMEI number of the device being provisioned. - * - * @param imei The IMEI number of the device being provisioned. - */ - @JsonProperty(JSON_PROPERTY_IMEI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setImei(String imei) { - this.imei = imei; - } - - /** - * The 2-digit device type provided on the ISO messages that the token is being provisioned to. - * - * @param isoDeviceType The 2-digit device type provided on the ISO messages that the token is - * being provisioned to. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo isoDeviceType(String isoDeviceType) { - this.isoDeviceType = isoDeviceType; - return this; - } - - /** - * The 2-digit device type provided on the ISO messages that the token is being provisioned to. - * - * @return isoDeviceType The 2-digit device type provided on the ISO messages that the token is - * being provisioned to. - */ - @JsonProperty(JSON_PROPERTY_ISO_DEVICE_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getIsoDeviceType() { - return isoDeviceType; - } - - /** - * The 2-digit device type provided on the ISO messages that the token is being provisioned to. - * - * @param isoDeviceType The 2-digit device type provided on the ISO messages that the token is - * being provisioned to. - */ - @JsonProperty(JSON_PROPERTY_ISO_DEVICE_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsoDeviceType(String isoDeviceType) { - this.isoDeviceType = isoDeviceType; - } - - /** - * The MSISDN of the device being provisioned. - * - * @param msisdn The MSISDN of the device being provisioned. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo msisdn(String msisdn) { - this.msisdn = msisdn; - return this; - } - - /** - * The MSISDN of the device being provisioned. - * - * @return msisdn The MSISDN of the device being provisioned. - */ - @JsonProperty(JSON_PROPERTY_MSISDN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMsisdn() { - return msisdn; - } - - /** - * The MSISDN of the device being provisioned. - * - * @param msisdn The MSISDN of the device being provisioned. - */ - @JsonProperty(JSON_PROPERTY_MSISDN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMsisdn(String msisdn) { - this.msisdn = msisdn; - } - - /** - * The name of the device operating system. - * - * @param osName The name of the device operating system. + * @param osName The operating system of the device used to provision the network token. * @return the current {@code DeviceInfo} instance, allowing for method chaining */ public DeviceInfo osName(String osName) { this.osName = osName; + isSetOsName = true; // mark as set return this; } /** - * The name of the device operating system. + * The operating system of the device used to provision the network token. * - * @return osName The name of the device operating system. + * @return osName The operating system of the device used to provision the network token. */ @JsonProperty(JSON_PROPERTY_OS_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,154 +101,35 @@ public String getOsName() { } /** - * The name of the device operating system. + * The operating system of the device used to provision the network token. * - * @param osName The name of the device operating system. + * @param osName The operating system of the device used to provision the network token. */ @JsonProperty(JSON_PROPERTY_OS_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOsName(String osName) { this.osName = osName; + isSetOsName = true; // mark as set } /** - * The version of the device operating system. - * - * @param osVersion The version of the device operating system. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo osVersion(String osVersion) { - this.osVersion = osVersion; - return this; - } - - /** - * The version of the device operating system. - * - * @return osVersion The version of the device operating system. - */ - @JsonProperty(JSON_PROPERTY_OS_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getOsVersion() { - return osVersion; - } - - /** - * The version of the device operating system. - * - * @param osVersion The version of the device operating system. - */ - @JsonProperty(JSON_PROPERTY_OS_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOsVersion(String osVersion) { - this.osVersion = osVersion; - } - - /** - * Different types of payments supported for the network token. - * - * @param paymentTypes Different types of payments supported for the network token. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo paymentTypes(List paymentTypes) { - this.paymentTypes = paymentTypes; - return this; - } - - public DeviceInfo addPaymentTypesItem(String paymentTypesItem) { - if (this.paymentTypes == null) { - this.paymentTypes = new ArrayList<>(); - } - this.paymentTypes.add(paymentTypesItem); - return this; - } - - /** - * Different types of payments supported for the network token. - * - * @return paymentTypes Different types of payments supported for the network token. - */ - @JsonProperty(JSON_PROPERTY_PAYMENT_TYPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPaymentTypes() { - return paymentTypes; - } - - /** - * Different types of payments supported for the network token. - * - * @param paymentTypes Different types of payments supported for the network token. - */ - @JsonProperty(JSON_PROPERTY_PAYMENT_TYPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPaymentTypes(List paymentTypes) { - this.paymentTypes = paymentTypes; - } - - /** - * The serial number of the device. - * - * @param serialNumber The serial number of the device. - * @return the current {@code DeviceInfo} instance, allowing for method chaining + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. */ - public DeviceInfo serialNumber(String serialNumber) { - this.serialNumber = serialNumber; + public DeviceInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; return this; } - /** - * The serial number of the device. - * - * @return serialNumber The serial number of the device. - */ - @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSerialNumber() { - return serialNumber; + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; } /** - * The serial number of the device. - * - * @param serialNumber The serial number of the device. + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. */ - @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSerialNumber(String serialNumber) { - this.serialNumber = serialNumber; - } - - /** - * The architecture or technology used for network token storage. - * - * @param storageTechnology The architecture or technology used for network token storage. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo storageTechnology(String storageTechnology) { - this.storageTechnology = storageTechnology; - return this; - } - - /** - * The architecture or technology used for network token storage. - * - * @return storageTechnology The architecture or technology used for network token storage. - */ - @JsonProperty(JSON_PROPERTY_STORAGE_TECHNOLOGY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStorageTechnology() { - return storageTechnology; - } - - /** - * The architecture or technology used for network token storage. - * - * @param storageTechnology The architecture or technology used for network token storage. - */ - @JsonProperty(JSON_PROPERTY_STORAGE_TECHNOLOGY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStorageTechnology(String storageTechnology) { - this.storageTechnology = storageTechnology; + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DeviceInfo object is equal to o. */ @@ -453,52 +142,21 @@ public boolean equals(Object o) { return false; } DeviceInfo deviceInfo = (DeviceInfo) o; - return Objects.equals(this.cardCaptureTechnology, deviceInfo.cardCaptureTechnology) - && Objects.equals(this.deviceName, deviceInfo.deviceName) - && Objects.equals(this.formFactor, deviceInfo.formFactor) - && Objects.equals(this.imei, deviceInfo.imei) - && Objects.equals(this.isoDeviceType, deviceInfo.isoDeviceType) - && Objects.equals(this.msisdn, deviceInfo.msisdn) - && Objects.equals(this.osName, deviceInfo.osName) - && Objects.equals(this.osVersion, deviceInfo.osVersion) - && Objects.equals(this.paymentTypes, deviceInfo.paymentTypes) - && Objects.equals(this.serialNumber, deviceInfo.serialNumber) - && Objects.equals(this.storageTechnology, deviceInfo.storageTechnology); + return Objects.equals(this.formFactor, deviceInfo.formFactor) + && Objects.equals(this.osName, deviceInfo.osName); } @Override public int hashCode() { - return Objects.hash( - cardCaptureTechnology, - deviceName, - formFactor, - imei, - isoDeviceType, - msisdn, - osName, - osVersion, - paymentTypes, - serialNumber, - storageTechnology); + return Objects.hash(formFactor, osName); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DeviceInfo {\n"); - sb.append(" cardCaptureTechnology: ") - .append(toIndentedString(cardCaptureTechnology)) - .append("\n"); - sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); - sb.append(" imei: ").append(toIndentedString(imei)).append("\n"); - sb.append(" isoDeviceType: ").append(toIndentedString(isoDeviceType)).append("\n"); - sb.append(" msisdn: ").append(toIndentedString(msisdn)).append("\n"); sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); - sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); - sb.append(" paymentTypes: ").append(toIndentedString(paymentTypes)).append("\n"); - sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); - sb.append(" storageTechnology: ").append(toIndentedString(storageTechnology)).append("\n"); sb.append("}"); return sb.toString(); } @@ -513,6 +171,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetOsName) { + addIfNull(nulls, JSON_PROPERTY_OS_NAME, this.osName); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DeviceInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java index a20738a43..3a5fc91d8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class DifferentCurrenciesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Boolean value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DifferentCurrenciesRestriction() {} /** @@ -40,6 +54,7 @@ public DifferentCurrenciesRestriction() {} */ public DifferentCurrenciesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setOperation(String operation) { */ public DifferentCurrenciesRestriction value(Boolean value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -109,6 +126,27 @@ public Boolean getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Boolean value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DifferentCurrenciesRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DifferentCurrenciesRestriction object is equal to o. */ @@ -151,6 +189,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DifferentCurrenciesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Duration.java b/src/main/java/com/adyen/model/balanceplatform/Duration.java index 67087e9a8..aa23def1a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Duration.java +++ b/src/main/java/com/adyen/model/balanceplatform/Duration.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -77,9 +79,21 @@ public static UnitEnum fromValue(String value) { public static final String JSON_PROPERTY_UNIT = "unit"; private UnitEnum unit; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUnit = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Integer value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Duration() {} /** @@ -93,6 +107,7 @@ public Duration() {} */ public Duration unit(UnitEnum unit) { this.unit = unit; + isSetUnit = true; // mark as set return this; } @@ -122,6 +137,7 @@ public UnitEnum getUnit() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUnit(UnitEnum unit) { this.unit = unit; + isSetUnit = true; // mark as set } /** @@ -134,6 +150,7 @@ public void setUnit(UnitEnum unit) { */ public Duration value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -161,6 +178,27 @@ public Integer getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Integer value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Duration includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Duration object is equal to o. */ @@ -201,6 +239,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetUnit) { + addIfNull(nulls, JSON_PROPERTY_UNIT, this.unit); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Duration given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java index 989e79ce3..dc2779b12 100644 --- a/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class EntryModesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { BARCODE(String.valueOf("barcode")), @@ -90,6 +95,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EntryModesRestriction() {} /** @@ -100,6 +114,7 @@ public EntryModesRestriction() {} */ public EntryModesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -123,6 +138,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -135,6 +151,7 @@ public void setOperation(String operation) { */ public EntryModesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -170,6 +187,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EntryModesRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EntryModesRestriction object is equal to o. */ @@ -211,6 +249,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EntryModesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Expiry.java b/src/main/java/com/adyen/model/balanceplatform/Expiry.java index ad0235bcc..e9ed35e58 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Expiry.java +++ b/src/main/java/com/adyen/model/balanceplatform/Expiry.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Expiry { public static final String JSON_PROPERTY_MONTH = "month"; private String month; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMonth = false; + public static final String JSON_PROPERTY_YEAR = "year"; private String year; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetYear = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Expiry() {} /** @@ -36,6 +50,7 @@ public Expiry() {} */ public Expiry month(String month) { this.month = month; + isSetMonth = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMonth(String month) { this.month = month; + isSetMonth = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setMonth(String month) { */ public Expiry year(String year) { this.year = year; + isSetYear = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setYear(String year) { this.year = year; + isSetYear = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Expiry includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Expiry object is equal to o. */ @@ -132,6 +170,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMonth) { + addIfNull(nulls, JSON_PROPERTY_MONTH, this.month); + } + if (isSetYear) { + addIfNull(nulls, JSON_PROPERTY_YEAR, this.year); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Expiry given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Fee.java b/src/main/java/com/adyen/model/balanceplatform/Fee.java index 160316204..b4afef08d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Fee.java +++ b/src/main/java/com/adyen/model/balanceplatform/Fee.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class Fee { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Fee() {} /** @@ -33,6 +44,7 @@ public Fee() {} */ public Fee amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Fee includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Fee object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Fee given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationRequest.java b/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationRequest.java index e6a010450..092a959e8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class FinishScaDeviceRegistrationRequest { public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FinishScaDeviceRegistrationRequest() {} /** @@ -36,6 +47,7 @@ public FinishScaDeviceRegistrationRequest() {} */ public FinishScaDeviceRegistrationRequest sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FinishScaDeviceRegistrationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this FinishScaDeviceRegistrationRequest object is equal to o. */ @@ -103,6 +136,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of FinishScaDeviceRegistrationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationResponse.java b/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationResponse.java index 201bd5cd0..f079a5c3a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class FinishScaDeviceRegistrationResponse { public static final String JSON_PROPERTY_SCA_DEVICE = "scaDevice"; private ScaDevice scaDevice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDevice = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FinishScaDeviceRegistrationResponse() {} /** @@ -34,6 +45,7 @@ public FinishScaDeviceRegistrationResponse() {} */ public FinishScaDeviceRegistrationResponse scaDevice(ScaDevice scaDevice) { this.scaDevice = scaDevice; + isSetScaDevice = true; // mark as set return this; } @@ -57,6 +69,27 @@ public ScaDevice getScaDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDevice(ScaDevice scaDevice) { this.scaDevice = scaDevice; + isSetScaDevice = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FinishScaDeviceRegistrationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this FinishScaDeviceRegistrationResponse object is equal to o. */ @@ -97,6 +130,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetScaDevice) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE, this.scaDevice); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of FinishScaDeviceRegistrationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java b/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java index a5b7260ca..9cae9c130 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class GetNetworkTokenResponse { public static final String JSON_PROPERTY_TOKEN = "token"; private NetworkToken token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GetNetworkTokenResponse() {} /** @@ -33,6 +44,7 @@ public GetNetworkTokenResponse() {} */ public GetNetworkTokenResponse token(NetworkToken token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -56,6 +68,27 @@ public NetworkToken getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(NetworkToken token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetNetworkTokenResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this GetNetworkTokenResponse object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of GetNetworkTokenResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GetTaxFormResponse.java b/src/main/java/com/adyen/model/balanceplatform/GetTaxFormResponse.java index 3a8702c6c..4ceb91439 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GetTaxFormResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/GetTaxFormResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class GetTaxFormResponse { public static final String JSON_PROPERTY_CONTENT = "content"; private byte[] content; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContent = false; + /** The content type of the tax form. Possible values: * **application/pdf** */ public enum ContentTypeEnum { APPLICATION_PDF(String.valueOf("application/pdf")); @@ -72,6 +77,15 @@ public static ContentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_CONTENT_TYPE = "contentType"; private ContentTypeEnum contentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContentType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GetTaxFormResponse() {} /** @@ -82,6 +96,7 @@ public GetTaxFormResponse() {} */ public GetTaxFormResponse content(byte[] content) { this.content = content; + isSetContent = true; // mark as set return this; } @@ -105,6 +120,7 @@ public byte[] getContent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContent(byte[] content) { this.content = content; + isSetContent = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setContent(byte[] content) { */ public GetTaxFormResponse contentType(ContentTypeEnum contentType) { this.contentType = contentType; + isSetContentType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public ContentTypeEnum getContentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContentType(ContentTypeEnum contentType) { this.contentType = contentType; + isSetContentType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetTaxFormResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this GetTaxFormResponse object is equal to o. */ @@ -179,6 +217,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetContent) { + addIfNull(nulls, JSON_PROPERTY_CONTENT, this.content); + } + if (isSetContentType) { + addIfNull(nulls, JSON_PROPERTY_CONTENT_TYPE, this.contentType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of GetTaxFormResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java index 3ca21beb3..e8d8d3fbe 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class GrantLimit { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GrantLimit() {} /** @@ -33,6 +44,7 @@ public GrantLimit() {} */ public GrantLimit amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantLimit includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this GrantLimit object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of GrantLimit given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java index 533556a4b..cf355c215 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,9 +39,15 @@ public class GrantOffer { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** The contract type of the grant offer. Possible value: **cashAdvance**, **loan**. */ public enum ContractTypeEnum { CASHADVANCE(String.valueOf("cashAdvance")), @@ -84,21 +92,45 @@ public static ContractTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_CONTRACT_TYPE = "contractType"; private ContractTypeEnum contractType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContractType = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FEE = "fee"; private Fee fee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REPAYMENT = "repayment"; private Repayment repayment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepayment = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private OffsetDateTime startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GrantOffer() {} /** @@ -109,6 +141,7 @@ public GrantOffer() {} */ public GrantOffer accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -132,6 +165,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -142,6 +176,7 @@ public void setAccountHolderId(String accountHolderId) { */ public GrantOffer amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -165,6 +200,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -176,6 +212,7 @@ public void setAmount(Amount amount) { */ public GrantOffer contractType(ContractTypeEnum contractType) { this.contractType = contractType; + isSetContractType = true; // mark as set return this; } @@ -201,6 +238,7 @@ public ContractTypeEnum getContractType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContractType(ContractTypeEnum contractType) { this.contractType = contractType; + isSetContractType = true; // mark as set } /** @@ -211,6 +249,7 @@ public void setContractType(ContractTypeEnum contractType) { */ public GrantOffer expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -234,6 +273,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -244,6 +284,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public GrantOffer fee(Fee fee) { this.fee = fee; + isSetFee = true; // mark as set return this; } @@ -267,6 +308,7 @@ public Fee getFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFee(Fee fee) { this.fee = fee; + isSetFee = true; // mark as set } /** @@ -277,6 +319,7 @@ public void setFee(Fee fee) { */ public GrantOffer id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -300,6 +343,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -310,6 +354,7 @@ public void setId(String id) { */ public GrantOffer repayment(Repayment repayment) { this.repayment = repayment; + isSetRepayment = true; // mark as set return this; } @@ -333,6 +378,7 @@ public Repayment getRepayment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRepayment(Repayment repayment) { this.repayment = repayment; + isSetRepayment = true; // mark as set } /** @@ -343,6 +389,7 @@ public void setRepayment(Repayment repayment) { */ public GrantOffer startsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -366,6 +413,27 @@ public OffsetDateTime getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantOffer includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this GrantOffer object is equal to o. */ @@ -420,6 +488,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetContractType) { + addIfNull(nulls, JSON_PROPERTY_CONTRACT_TYPE, this.contractType); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRepayment) { + addIfNull(nulls, JSON_PROPERTY_REPAYMENT, this.repayment); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of GrantOffer given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java index 31a8f8664..b6ea162f1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class GrantOffers { public static final String JSON_PROPERTY_GRANT_OFFERS = "grantOffers"; private List grantOffers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOffers = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GrantOffers() {} /** @@ -35,6 +46,7 @@ public GrantOffers() {} */ public GrantOffers grantOffers(List grantOffers) { this.grantOffers = grantOffers; + isSetGrantOffers = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getGrantOffers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantOffers(List grantOffers) { this.grantOffers = grantOffers; + isSetGrantOffers = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantOffers includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this GrantOffers object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetGrantOffers) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFERS, this.grantOffers); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of GrantOffers given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java index 1b30947e2..1192dbea7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class HKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; private String clearingCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + /** **hkLocal** */ public enum TypeEnum { HKLOCAL(String.valueOf("hkLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public HKLocalAccountIdentification() {} /** @@ -88,6 +105,7 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -115,6 +133,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this HKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java index 5683cbc72..dd013c83c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class HULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **huLocal** */ public enum TypeEnum { HULOCAL(String.valueOf("huLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public HULocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this HULocalAccountIdentification object is equal to o. */ @@ -179,6 +217,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Href.java b/src/main/java/com/adyen/model/balanceplatform/Href.java index c228ee0e0..fd87d96a8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Href.java +++ b/src/main/java/com/adyen/model/balanceplatform/Href.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class Href { public static final String JSON_PROPERTY_HREF = "href"; private String href; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHref = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Href() {} /** @@ -33,6 +44,7 @@ public Href() {} */ public Href href(String href) { this.href = href; + isSetHref = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getHref() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHref(String href) { this.href = href; + isSetHref = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Href includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Href object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetHref) { + addIfNull(nulls, JSON_PROPERTY_HREF, this.href); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Href given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java index 19889943a..47e0bf4a8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IbanAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IbanAccountIdentification object is equal to o. */ @@ -185,6 +223,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentificationRequirement.java b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentificationRequirement.java index f0747e208..0cac86a94 100644 --- a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentificationRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentificationRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +35,15 @@ public class IbanAccountIdentificationRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_IBAN_PREFIXES = "ibanPrefixes"; private List ibanPrefixes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIbanPrefixes = false; + /** **ibanAccountIdentificationRequirement** */ public enum TypeEnum { IBANACCOUNTIDENTIFICATIONREQUIREMENT(String.valueOf("ibanAccountIdentificationRequirement")); @@ -78,6 +86,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IbanAccountIdentificationRequirement() {} /** @@ -91,6 +108,7 @@ public IbanAccountIdentificationRequirement() {} */ public IbanAccountIdentificationRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -118,6 +136,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -130,6 +149,7 @@ public void setDescription(String description) { */ public IbanAccountIdentificationRequirement ibanPrefixes(List ibanPrefixes) { this.ibanPrefixes = ibanPrefixes; + isSetIbanPrefixes = true; // mark as set return this; } @@ -163,6 +183,7 @@ public List getIbanPrefixes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIbanPrefixes(List ibanPrefixes) { this.ibanPrefixes = ibanPrefixes; + isSetIbanPrefixes = true; // mark as set } /** @@ -174,6 +195,7 @@ public void setIbanPrefixes(List ibanPrefixes) { */ public IbanAccountIdentificationRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -197,6 +219,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IbanAccountIdentificationRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IbanAccountIdentificationRequirement object is equal to o. */ @@ -241,6 +284,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetIbanPrefixes) { + addIfNull(nulls, JSON_PROPERTY_IBAN_PREFIXES, this.ibanPrefixes); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IbanAccountIdentificationRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java b/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java index 00236b240..f859327dc 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class InternationalTransactionRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Boolean value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InternationalTransactionRestriction() {} /** @@ -40,6 +54,7 @@ public InternationalTransactionRestriction() {} */ public InternationalTransactionRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setOperation(String operation) { */ public InternationalTransactionRestriction value(Boolean value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -109,6 +126,27 @@ public Boolean getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Boolean value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InternationalTransactionRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InternationalTransactionRestriction object is equal to o. */ @@ -151,6 +189,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InternationalTransactionRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java index 3d7f8e77f..06ae52514 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java +++ b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class InvalidField { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InvalidField() {} /** @@ -43,6 +60,7 @@ public InvalidField() {} */ public InvalidField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setName(String name) { */ public InvalidField value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setValue(String value) { */ public InvalidField message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InvalidField object is equal to o. */ @@ -175,6 +218,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InvalidField given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Link.java b/src/main/java/com/adyen/model/balanceplatform/Link.java index b8be30eab..d47d0ec15 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Link.java +++ b/src/main/java/com/adyen/model/balanceplatform/Link.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class Link { public static final String JSON_PROPERTY_FIRST = "first"; private Href first; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirst = false; + public static final String JSON_PROPERTY_LAST = "last"; private Href last; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLast = false; + public static final String JSON_PROPERTY_NEXT = "next"; private Href next; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNext = false; + public static final String JSON_PROPERTY_PREVIOUS = "previous"; private Href previous; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrevious = false; + public static final String JSON_PROPERTY_SELF = "self"; private Href self; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelf = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Link() {} /** @@ -51,6 +74,7 @@ public Link() {} */ public Link first(Href first) { this.first = first; + isSetFirst = true; // mark as set return this; } @@ -74,6 +98,7 @@ public Href getFirst() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirst(Href first) { this.first = first; + isSetFirst = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setFirst(Href first) { */ public Link last(Href last) { this.last = last; + isSetLast = true; // mark as set return this; } @@ -107,6 +133,7 @@ public Href getLast() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLast(Href last) { this.last = last; + isSetLast = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setLast(Href last) { */ public Link next(Href next) { this.next = next; + isSetNext = true; // mark as set return this; } @@ -140,6 +168,7 @@ public Href getNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNext(Href next) { this.next = next; + isSetNext = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setNext(Href next) { */ public Link previous(Href previous) { this.previous = previous; + isSetPrevious = true; // mark as set return this; } @@ -173,6 +203,7 @@ public Href getPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrevious(Href previous) { this.previous = previous; + isSetPrevious = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setPrevious(Href previous) { */ public Link self(Href self) { this.self = self; + isSetSelf = true; // mark as set return this; } @@ -206,6 +238,27 @@ public Href getSelf() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelf(Href self) { this.self = self; + isSetSelf = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Link includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Link object is equal to o. */ @@ -253,6 +306,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFirst) { + addIfNull(nulls, JSON_PROPERTY_FIRST, this.first); + } + if (isSetLast) { + addIfNull(nulls, JSON_PROPERTY_LAST, this.last); + } + if (isSetNext) { + addIfNull(nulls, JSON_PROPERTY_NEXT, this.next); + } + if (isSetPrevious) { + addIfNull(nulls, JSON_PROPERTY_PREVIOUS, this.previous); + } + if (isSetSelf) { + addIfNull(nulls, JSON_PROPERTY_SELF, this.self); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Link given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ListAssociationsResponse.java b/src/main/java/com/adyen/model/balanceplatform/ListAssociationsResponse.java index 8b2f837fa..5f28e7243 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ListAssociationsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/ListAssociationsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,15 +32,33 @@ public class ListAssociationsResponse { public static final String JSON_PROPERTY_LINKS = "_links"; private Link links; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLinks = false; + public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ITEMS_TOTAL = "itemsTotal"; private Integer itemsTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemsTotal = false; + public static final String JSON_PROPERTY_PAGES_TOTAL = "pagesTotal"; private Integer pagesTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPagesTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ListAssociationsResponse() {} /** @@ -49,6 +69,7 @@ public ListAssociationsResponse() {} */ public ListAssociationsResponse links(Link links) { this.links = links; + isSetLinks = true; // mark as set return this; } @@ -72,6 +93,7 @@ public Link getLinks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLinks(Link links) { this.links = links; + isSetLinks = true; // mark as set } /** @@ -82,6 +104,7 @@ public void setLinks(Link links) { */ public ListAssociationsResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -113,6 +136,7 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set } /** @@ -123,6 +147,7 @@ public void setData(List data) { */ public ListAssociationsResponse itemsTotal(Integer itemsTotal) { this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set return this; } @@ -146,6 +171,7 @@ public Integer getItemsTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItemsTotal(Integer itemsTotal) { this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set } /** @@ -156,6 +182,7 @@ public void setItemsTotal(Integer itemsTotal) { */ public ListAssociationsResponse pagesTotal(Integer pagesTotal) { this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set return this; } @@ -179,6 +206,27 @@ public Integer getPagesTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPagesTotal(Integer pagesTotal) { this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListAssociationsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ListAssociationsResponse object is equal to o. */ @@ -224,6 +272,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLinks) { + addIfNull(nulls, JSON_PROPERTY_LINKS, this.links); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetItemsTotal) { + addIfNull(nulls, JSON_PROPERTY_ITEMS_TOTAL, this.itemsTotal); + } + if (isSetPagesTotal) { + addIfNull(nulls, JSON_PROPERTY_PAGES_TOTAL, this.pagesTotal); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ListAssociationsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java b/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java index fb3fe0ebb..b587da39b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class ListNetworkTokensResponse { public static final String JSON_PROPERTY_NETWORK_TOKENS = "networkTokens"; private List networkTokens; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTokens = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ListNetworkTokensResponse() {} /** @@ -35,6 +46,7 @@ public ListNetworkTokensResponse() {} */ public ListNetworkTokensResponse networkTokens(List networkTokens) { this.networkTokens = networkTokens; + isSetNetworkTokens = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getNetworkTokens() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTokens(List networkTokens) { this.networkTokens = networkTokens; + isSetNetworkTokens = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListNetworkTokensResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ListNetworkTokensResponse object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNetworkTokens) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKENS, this.networkTokens); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ListNetworkTokensResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java index afe47fe42..163375624 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class MatchingTransactionsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Integer value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MatchingTransactionsRestriction() {} /** @@ -40,6 +54,7 @@ public MatchingTransactionsRestriction() {} */ public MatchingTransactionsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public MatchingTransactionsRestriction value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -97,6 +114,27 @@ public Integer getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Integer value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MatchingTransactionsRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MatchingTransactionsRestriction object is equal to o. */ @@ -139,6 +177,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MatchingTransactionsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MatchingValuesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MatchingValuesRestriction.java index fead0fb06..2f7cc4dc0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MatchingValuesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MatchingValuesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class MatchingValuesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { ACQUIRERID(String.valueOf("acquirerId")), @@ -82,6 +87,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MatchingValuesRestriction() {} /** @@ -92,6 +106,7 @@ public MatchingValuesRestriction() {} */ public MatchingValuesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -115,6 +130,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -125,6 +141,7 @@ public void setOperation(String operation) { */ public MatchingValuesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -156,6 +173,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MatchingValuesRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MatchingValuesRestriction object is equal to o. */ @@ -197,6 +235,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MatchingValuesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java index ad2ef17c7..382827fa3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,9 +27,21 @@ public class MccsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MccsRestriction() {} /** @@ -38,6 +52,7 @@ public MccsRestriction() {} */ public MccsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -61,6 +76,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -71,6 +87,7 @@ public void setOperation(String operation) { */ public MccsRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -102,6 +119,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MccsRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MccsRestriction object is equal to o. */ @@ -143,6 +181,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MccsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java b/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java index 96533ff3e..d8c3448eb 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class MerchantAcquirerPair { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantAcquirerPair() {} /** @@ -39,6 +53,7 @@ public MerchantAcquirerPair() {} */ public MerchantAcquirerPair acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setAcquirerId(String acquirerId) { */ public MerchantAcquirerPair merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -95,6 +112,27 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantAcquirerPair includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantAcquirerPair object is equal to o. */ @@ -136,6 +174,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantAcquirerPair given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java index c9224bdac..b11938386 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class MerchantNamesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantNamesRestriction() {} /** @@ -41,6 +55,7 @@ public MerchantNamesRestriction() {} */ public MerchantNamesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public MerchantNamesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantNamesRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantNamesRestriction object is equal to o. */ @@ -146,6 +184,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantNamesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java index b65cbd58d..73b71a48e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class MerchantsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantsRestriction() {} /** @@ -41,6 +55,7 @@ public MerchantsRestriction() {} */ public MerchantsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public MerchantsRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantsRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantsRestriction object is equal to o. */ @@ -146,6 +184,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java index 764bfed0a..d6ca1f7c0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class NOLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **noLocal** */ public enum TypeEnum { NOLOCAL(String.valueOf("noLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NOLocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NOLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NOLocalAccountIdentification object is equal to o. */ @@ -179,6 +217,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java index 83606b6c9..c3e1c4a9f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class NZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **nzLocal** */ public enum TypeEnum { NZLOCAL(String.valueOf("nzLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NZLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NZLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Name.java b/src/main/java/com/adyen/model/balanceplatform/Name.java index 66e9d37aa..9f8b1b4db 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Name.java +++ b/src/main/java/com/adyen/model/balanceplatform/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Name { public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Name() {} /** @@ -36,6 +50,7 @@ public Name() {} */ public Name firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setFirstName(String firstName) { */ public Name lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Name includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Name object is equal to o. */ @@ -133,6 +171,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Name given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java b/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java index 10a5f39d0..e6e2216fc 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,18 +40,33 @@ public class NetworkToken { public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; private String brandVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariant = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DEVICE = "device"; private DeviceInfo device; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDevice = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + /** * The status of the network token. Possible values: **active**, **inactive**, **suspended**, * **closed**. @@ -101,15 +118,33 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TOKEN_LAST_FOUR = "tokenLastFour"; private String tokenLastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenLastFour = false; + public static final String JSON_PROPERTY_TOKEN_REQUESTOR = "tokenRequestor"; private NetworkTokenRequestor tokenRequestor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestor = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkToken() {} /** @@ -122,6 +157,7 @@ public NetworkToken() {} */ public NetworkToken brandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set return this; } @@ -149,6 +185,7 @@ public String getBrandVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set } /** @@ -163,6 +200,7 @@ public void setBrandVariant(String brandVariant) { */ public NetworkToken creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -194,6 +232,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -204,6 +243,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public NetworkToken device(DeviceInfo device) { this.device = device; + isSetDevice = true; // mark as set return this; } @@ -227,6 +267,7 @@ public DeviceInfo getDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDevice(DeviceInfo device) { this.device = device; + isSetDevice = true; // mark as set } /** @@ -237,6 +278,7 @@ public void setDevice(DeviceInfo device) { */ public NetworkToken id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -260,6 +302,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -271,6 +314,7 @@ public void setId(String id) { */ public NetworkToken paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -296,6 +340,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -308,6 +353,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public NetworkToken status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -335,6 +381,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -345,6 +392,7 @@ public void setStatus(StatusEnum status) { */ public NetworkToken tokenLastFour(String tokenLastFour) { this.tokenLastFour = tokenLastFour; + isSetTokenLastFour = true; // mark as set return this; } @@ -368,6 +416,7 @@ public String getTokenLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenLastFour(String tokenLastFour) { this.tokenLastFour = tokenLastFour; + isSetTokenLastFour = true; // mark as set } /** @@ -378,6 +427,7 @@ public void setTokenLastFour(String tokenLastFour) { */ public NetworkToken tokenRequestor(NetworkTokenRequestor tokenRequestor) { this.tokenRequestor = tokenRequestor; + isSetTokenRequestor = true; // mark as set return this; } @@ -401,6 +451,7 @@ public NetworkTokenRequestor getTokenRequestor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenRequestor(NetworkTokenRequestor tokenRequestor) { this.tokenRequestor = tokenRequestor; + isSetTokenRequestor = true; // mark as set } /** @@ -411,6 +462,7 @@ public void setTokenRequestor(NetworkTokenRequestor tokenRequestor) { */ public NetworkToken type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -434,6 +486,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkToken includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NetworkToken object is equal to o. */ @@ -500,6 +573,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBrandVariant) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANT, this.brandVariant); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDevice) { + addIfNull(nulls, JSON_PROPERTY_DEVICE, this.device); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTokenLastFour) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_LAST_FOUR, this.tokenLastFour); + } + if (isSetTokenRequestor) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUESTOR, this.tokenRequestor); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NetworkToken given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataRequest.java b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataRequest.java index 33a0c67e4..3ab5eb8be 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class NetworkTokenActivationDataRequest { public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenActivationDataRequest() {} /** @@ -43,6 +54,7 @@ public NetworkTokenActivationDataRequest() {} */ public NetworkTokenActivationDataRequest sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -84,6 +96,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenActivationDataRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NetworkTokenActivationDataRequest object is equal to o. */ @@ -124,6 +157,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NetworkTokenActivationDataRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataResponse.java b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataResponse.java index 27bd58cba..b0a6ede0c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class NetworkTokenActivationDataResponse { public static final String JSON_PROPERTY_SDK_INPUT = "sdkInput"; private String sdkInput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenActivationDataResponse() {} /** @@ -44,6 +55,7 @@ public NetworkTokenActivationDataResponse() {} */ public NetworkTokenActivationDataResponse sdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set return this; } @@ -87,6 +99,27 @@ public String getSdkInput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenActivationDataResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NetworkTokenActivationDataResponse object is equal to o. */ @@ -127,6 +160,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSdkInput) { + addIfNull(nulls, JSON_PROPERTY_SDK_INPUT, this.sdkInput); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NetworkTokenActivationDataResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenRequestor.java b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenRequestor.java index 0949bb0a0..7195b7e40 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenRequestor.java +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenRequestor.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class NetworkTokenRequestor { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenRequestor() {} /** @@ -39,6 +53,7 @@ public NetworkTokenRequestor() {} */ public NetworkTokenRequestor id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setId(String id) { */ public NetworkTokenRequestor name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -95,6 +112,27 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenRequestor includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NetworkTokenRequestor object is equal to o. */ @@ -136,6 +174,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NetworkTokenRequestor given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java index fba8b6740..1c2d94e20 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,13 +34,22 @@ public class NumberAndBicAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; private AdditionalBankIdentification additionalBankIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **numberAndBic** */ public enum TypeEnum { NUMBERANDBIC(String.valueOf("numberAndBic")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NumberAndBicAccountIdentification() {} /** @@ -94,6 +114,7 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +142,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -133,6 +155,7 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -157,6 +180,7 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set } /** @@ -168,6 +192,7 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -191,6 +216,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NumberAndBicAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this NumberAndBicAccountIdentification object is equal to o. */ @@ -275,6 +323,40 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java index fb7880c65..57407a312 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class PLLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **plLocal** */ public enum TypeEnum { PLLOCAL(String.valueOf("plLocal")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PLLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PLLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PLLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java index 9453624ea..a5c6abd3c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,12 +31,27 @@ public class PaginatedAccountHoldersResponse { public static final String JSON_PROPERTY_ACCOUNT_HOLDERS = "accountHolders"; private List accountHolders; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolders = false; + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedAccountHoldersResponse() {} /** @@ -46,6 +63,7 @@ public PaginatedAccountHoldersResponse() {} */ public PaginatedAccountHoldersResponse accountHolders(List accountHolders) { this.accountHolders = accountHolders; + isSetAccountHolders = true; // mark as set return this; } @@ -77,6 +95,7 @@ public List getAccountHolders() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolders(List accountHolders) { this.accountHolders = accountHolders; + isSetAccountHolders = true; // mark as set } /** @@ -88,6 +107,7 @@ public void setAccountHolders(List accountHolders) { */ public PaginatedAccountHoldersResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -111,6 +131,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -122,6 +143,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedAccountHoldersResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -145,6 +167,27 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedAccountHoldersResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaginatedAccountHoldersResponse object is equal to o. */ @@ -189,6 +232,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolders) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDERS, this.accountHolders); + } + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaginatedAccountHoldersResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java index 34c37f969..c975436f5 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,12 +31,27 @@ public class PaginatedBalanceAccountsResponse { public static final String JSON_PROPERTY_BALANCE_ACCOUNTS = "balanceAccounts"; private List balanceAccounts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccounts = false; + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedBalanceAccountsResponse() {} /** @@ -47,6 +64,7 @@ public PaginatedBalanceAccountsResponse() {} public PaginatedBalanceAccountsResponse balanceAccounts( List balanceAccounts) { this.balanceAccounts = balanceAccounts; + isSetBalanceAccounts = true; // mark as set return this; } @@ -79,6 +97,7 @@ public List getBalanceAccounts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccounts(List balanceAccounts) { this.balanceAccounts = balanceAccounts; + isSetBalanceAccounts = true; // mark as set } /** @@ -90,6 +109,7 @@ public void setBalanceAccounts(List balanceAccounts) { */ public PaginatedBalanceAccountsResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -113,6 +133,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -124,6 +145,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedBalanceAccountsResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -147,6 +169,27 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedBalanceAccountsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaginatedBalanceAccountsResponse object is equal to o. */ @@ -191,6 +234,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccounts) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNTS, this.balanceAccounts); + } + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaginatedBalanceAccountsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderItemResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderItemResponse.java index 3c817d137..35253b6da 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderItemResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderItemResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,12 +31,27 @@ public class PaginatedGetCardOrderItemResponse { public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedGetCardOrderItemResponse() {} /** @@ -46,6 +63,7 @@ public PaginatedGetCardOrderItemResponse() {} */ public PaginatedGetCardOrderItemResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -77,6 +95,7 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set } /** @@ -88,6 +107,7 @@ public void setData(List data) { */ public PaginatedGetCardOrderItemResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -111,6 +131,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -122,6 +143,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedGetCardOrderItemResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -145,6 +167,27 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedGetCardOrderItemResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaginatedGetCardOrderItemResponse object is equal to o. */ @@ -189,6 +232,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaginatedGetCardOrderItemResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderResponse.java index ef97d58f7..1311ac6e2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,12 +31,27 @@ public class PaginatedGetCardOrderResponse { public static final String JSON_PROPERTY_CARD_ORDERS = "cardOrders"; private List cardOrders; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardOrders = false; + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedGetCardOrderResponse() {} /** @@ -46,6 +63,7 @@ public PaginatedGetCardOrderResponse() {} */ public PaginatedGetCardOrderResponse cardOrders(List cardOrders) { this.cardOrders = cardOrders; + isSetCardOrders = true; // mark as set return this; } @@ -77,6 +95,7 @@ public List getCardOrders() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardOrders(List cardOrders) { this.cardOrders = cardOrders; + isSetCardOrders = true; // mark as set } /** @@ -88,6 +107,7 @@ public void setCardOrders(List cardOrders) { */ public PaginatedGetCardOrderResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -111,6 +131,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -122,6 +143,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedGetCardOrderResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -145,6 +167,27 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedGetCardOrderResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaginatedGetCardOrderResponse object is equal to o. */ @@ -188,6 +231,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardOrders) { + addIfNull(nulls, JSON_PROPERTY_CARD_ORDERS, this.cardOrders); + } + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaginatedGetCardOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java index 96ec52439..c3b871132 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,12 +31,27 @@ public class PaginatedPaymentInstrumentsResponse { public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENTS = "paymentInstruments"; private List paymentInstruments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstruments = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedPaymentInstrumentsResponse() {} /** @@ -46,6 +63,7 @@ public PaginatedPaymentInstrumentsResponse() {} */ public PaginatedPaymentInstrumentsResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -69,6 +87,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -80,6 +99,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedPaymentInstrumentsResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -103,6 +123,7 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setHasPrevious(Boolean hasPrevious) { public PaginatedPaymentInstrumentsResponse paymentInstruments( List paymentInstruments) { this.paymentInstruments = paymentInstruments; + isSetPaymentInstruments = true; // mark as set return this; } @@ -147,6 +169,27 @@ public List getPaymentInstruments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstruments(List paymentInstruments) { this.paymentInstruments = paymentInstruments; + isSetPaymentInstruments = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedPaymentInstrumentsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaginatedPaymentInstrumentsResponse object is equal to o. */ @@ -192,6 +235,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + if (isSetPaymentInstruments) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENTS, this.paymentInstruments); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaginatedPaymentInstrumentsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java index dd614b16b..834d3829c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -48,36 +50,69 @@ public class PaymentInstrument { private List additionalBankAccountIdentifications; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankAccountIdentifications = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountDetails bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; private String paymentInstrumentGroupId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentGroupId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REPLACED_BY_ID = "replacedById"; private String replacedById; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacedById = false; + public static final String JSON_PROPERTY_REPLACEMENT_OF_ID = "replacementOfId"; private String replacementOfId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacementOfId = false; + /** * The status of the payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -135,9 +170,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for the status of the payment instrument. Possible values: **accountClosure**, * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, @@ -201,6 +242,9 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + /** The type of payment instrument. Possible values: **card**, **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -245,6 +289,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrument() {} /** @@ -262,6 +315,7 @@ public PaymentInstrument additionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set return this; } @@ -308,6 +362,7 @@ public void setAdditionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set } /** @@ -322,6 +377,7 @@ public void setAdditionalBankAccountIdentifications( */ public PaymentInstrument balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -353,6 +409,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -363,6 +420,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public PaymentInstrument bankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -386,6 +444,7 @@ public BankAccountDetails getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -396,6 +455,7 @@ public void setBankAccount(BankAccountDetails bankAccount) { */ public PaymentInstrument card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -419,6 +479,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -429,6 +490,7 @@ public void setCard(Card card) { */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -452,6 +514,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -462,6 +525,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -485,6 +549,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -498,6 +563,7 @@ public void setId(String id) { */ public PaymentInstrument issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -527,6 +593,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -541,6 +608,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public PaymentInstrument paymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set return this; } @@ -572,6 +640,7 @@ public String getPaymentInstrumentGroupId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set } /** @@ -582,6 +651,7 @@ public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -605,6 +675,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -616,6 +687,7 @@ public void setReference(String reference) { */ public PaymentInstrument replacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set return this; } @@ -641,6 +713,7 @@ public String getReplacedById() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set } /** @@ -652,6 +725,7 @@ public void setReplacedById(String replacedById) { */ public PaymentInstrument replacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set return this; } @@ -677,6 +751,7 @@ public String getReplacementOfId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set } /** @@ -702,6 +777,7 @@ public void setReplacementOfId(String replacementOfId) { */ public PaymentInstrument status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -755,6 +831,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -767,6 +844,7 @@ public void setStatus(StatusEnum status) { */ public PaymentInstrument statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -794,6 +872,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -810,6 +889,7 @@ public void setStatusComment(String statusComment) { */ public PaymentInstrument statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -845,6 +925,7 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set } /** @@ -855,6 +936,7 @@ public void setStatusReason(StatusReasonEnum statusReason) { */ public PaymentInstrument type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -878,6 +960,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrument includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrument object is equal to o. */ @@ -966,6 +1069,75 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalBankAccountIdentifications) { + addIfNull( + nulls, + JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS, + this.additionalBankAccountIdentifications); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetPaymentInstrumentGroupId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID, this.paymentInstrumentGroupId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReplacedById) { + addIfNull(nulls, JSON_PROPERTY_REPLACED_BY_ID, this.replacedById); + } + if (isSetReplacementOfId) { + addIfNull(nulls, JSON_PROPERTY_REPLACEMENT_OF_ID, this.replacementOfId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java index 04a81415a..3f326a3f0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,21 +34,45 @@ public class PaymentInstrumentGroup { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PROPERTIES = "properties"; private Map properties; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProperties = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TX_VARIANT = "txVariant"; private String txVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxVariant = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentGroup() {} /** @@ -61,6 +87,7 @@ public PaymentInstrumentGroup() {} */ public PaymentInstrumentGroup balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -92,6 +119,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -102,6 +130,7 @@ public void setBalancePlatform(String balancePlatform) { */ public PaymentInstrumentGroup description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -125,6 +154,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -135,6 +165,7 @@ public void setDescription(String description) { */ public PaymentInstrumentGroup id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -158,6 +189,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -168,6 +200,7 @@ public void setId(String id) { */ public PaymentInstrumentGroup properties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set return this; } @@ -199,6 +232,7 @@ public Map getProperties() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProperties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set } /** @@ -209,6 +243,7 @@ public void setProperties(Map properties) { */ public PaymentInstrumentGroup reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -232,6 +267,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -242,6 +278,7 @@ public void setReference(String reference) { */ public PaymentInstrumentGroup txVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set return this; } @@ -265,6 +302,27 @@ public String getTxVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentGroup includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrumentGroup object is equal to o. */ @@ -314,6 +372,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetProperties) { + addIfNull(nulls, JSON_PROPERTY_PROPERTIES, this.properties); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTxVariant) { + addIfNull(nulls, JSON_PROPERTY_TX_VARIANT, this.txVariant); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrumentGroup given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java index fdbe8a44f..3b9ae69a3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,18 +33,39 @@ public class PaymentInstrumentGroupInfo { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_PROPERTIES = "properties"; private Map properties; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProperties = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TX_VARIANT = "txVariant"; private String txVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxVariant = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentGroupInfo() {} /** @@ -57,6 +80,7 @@ public PaymentInstrumentGroupInfo() {} */ public PaymentInstrumentGroupInfo balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -88,6 +112,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -98,6 +123,7 @@ public void setBalancePlatform(String balancePlatform) { */ public PaymentInstrumentGroupInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -121,6 +147,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -131,6 +158,7 @@ public void setDescription(String description) { */ public PaymentInstrumentGroupInfo properties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set return this; } @@ -162,6 +190,7 @@ public Map getProperties() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProperties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set } /** @@ -172,6 +201,7 @@ public void setProperties(Map properties) { */ public PaymentInstrumentGroupInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -195,6 +225,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -205,6 +236,7 @@ public void setReference(String reference) { */ public PaymentInstrumentGroupInfo txVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set return this; } @@ -228,6 +260,27 @@ public String getTxVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentGroupInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrumentGroupInfo object is equal to o. */ @@ -275,6 +328,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetProperties) { + addIfNull(nulls, JSON_PROPERTY_PROPERTIES, this.properties); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTxVariant) { + addIfNull(nulls, JSON_PROPERTY_TX_VARIANT, this.txVariant); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrumentGroupInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java index 8b24392cf..3a43b4a9c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,24 +41,45 @@ public class PaymentInstrumentInfo { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountModel bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private CardInfo card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; private String paymentInstrumentGroupId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentGroupId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The status of the payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -114,9 +137,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for the status of the payment instrument. Possible values: **accountClosure**, * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, @@ -180,6 +209,9 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + /** The type of payment instrument. Possible values: **card**, **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -224,6 +256,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentInfo() {} /** @@ -238,6 +279,7 @@ public PaymentInstrumentInfo() {} */ public PaymentInstrumentInfo balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -269,6 +311,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -279,6 +322,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public PaymentInstrumentInfo bankAccount(BankAccountModel bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -302,6 +346,7 @@ public BankAccountModel getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountModel bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -312,6 +357,7 @@ public void setBankAccount(BankAccountModel bankAccount) { */ public PaymentInstrumentInfo card(CardInfo card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -335,6 +381,7 @@ public CardInfo getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(CardInfo card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -345,6 +392,7 @@ public void setCard(CardInfo card) { */ public PaymentInstrumentInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -368,6 +416,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -381,6 +430,7 @@ public void setDescription(String description) { */ public PaymentInstrumentInfo issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -410,6 +460,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -424,6 +475,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public PaymentInstrumentInfo paymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set return this; } @@ -455,6 +507,7 @@ public String getPaymentInstrumentGroupId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set } /** @@ -465,6 +518,7 @@ public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { */ public PaymentInstrumentInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -488,6 +542,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -513,6 +568,7 @@ public void setReference(String reference) { */ public PaymentInstrumentInfo status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -566,6 +622,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -578,6 +635,7 @@ public void setStatus(StatusEnum status) { */ public PaymentInstrumentInfo statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -605,6 +663,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -621,6 +680,7 @@ public void setStatusComment(String statusComment) { */ public PaymentInstrumentInfo statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -656,6 +716,7 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set } /** @@ -666,6 +727,7 @@ public void setStatusReason(StatusReasonEnum statusReason) { */ public PaymentInstrumentInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -689,6 +751,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrumentInfo object is equal to o. */ @@ -762,6 +845,60 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetPaymentInstrumentGroupId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID, this.paymentInstrumentGroupId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrumentInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRequirement.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRequirement.java index 60fb0e6b3..a620d7483 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,16 +38,28 @@ public class PaymentInstrumentRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODES = "issuingCountryCodes"; private List issuingCountryCodes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCodes = false; + public static final String JSON_PROPERTY_ONLY_FOR_CROSS_BALANCE_PLATFORM = "onlyForCrossBalancePlatform"; private Boolean onlyForCrossBalancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOnlyForCrossBalancePlatform = false; + /** * The type of the payment instrument. For example, \"BankAccount\" or * \"Card\". @@ -93,6 +107,9 @@ public static PaymentInstrumentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE = "paymentInstrumentType"; private PaymentInstrumentTypeEnum paymentInstrumentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentType = false; + /** **paymentInstrumentRequirement** */ public enum TypeEnum { PAYMENTINSTRUMENTREQUIREMENT(String.valueOf("paymentInstrumentRequirement")); @@ -135,6 +152,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentRequirement() {} /** @@ -147,6 +173,7 @@ public PaymentInstrumentRequirement() {} */ public PaymentInstrumentRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -174,6 +201,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -187,6 +215,7 @@ public void setDescription(String description) { */ public PaymentInstrumentRequirement issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -216,6 +245,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -227,6 +257,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public PaymentInstrumentRequirement issuingCountryCodes(List issuingCountryCodes) { this.issuingCountryCodes = issuingCountryCodes; + isSetIssuingCountryCodes = true; // mark as set return this; } @@ -260,6 +291,7 @@ public List getIssuingCountryCodes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCodes(List issuingCountryCodes) { this.issuingCountryCodes = issuingCountryCodes; + isSetIssuingCountryCodes = true; // mark as set } /** @@ -272,6 +304,7 @@ public void setIssuingCountryCodes(List issuingCountryCodes) { public PaymentInstrumentRequirement onlyForCrossBalancePlatform( Boolean onlyForCrossBalancePlatform) { this.onlyForCrossBalancePlatform = onlyForCrossBalancePlatform; + isSetOnlyForCrossBalancePlatform = true; // mark as set return this; } @@ -297,6 +330,7 @@ public Boolean getOnlyForCrossBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOnlyForCrossBalancePlatform(Boolean onlyForCrossBalancePlatform) { this.onlyForCrossBalancePlatform = onlyForCrossBalancePlatform; + isSetOnlyForCrossBalancePlatform = true; // mark as set } /** @@ -310,6 +344,7 @@ public void setOnlyForCrossBalancePlatform(Boolean onlyForCrossBalancePlatform) public PaymentInstrumentRequirement paymentInstrumentType( PaymentInstrumentTypeEnum paymentInstrumentType) { this.paymentInstrumentType = paymentInstrumentType; + isSetPaymentInstrumentType = true; // mark as set return this; } @@ -337,6 +372,7 @@ public PaymentInstrumentTypeEnum getPaymentInstrumentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentType(PaymentInstrumentTypeEnum paymentInstrumentType) { this.paymentInstrumentType = paymentInstrumentType; + isSetPaymentInstrumentType = true; // mark as set } /** @@ -347,6 +383,7 @@ public void setPaymentInstrumentType(PaymentInstrumentTypeEnum paymentInstrument */ public PaymentInstrumentRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -370,6 +407,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrumentRequirement object is equal to o. */ @@ -435,6 +493,46 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetIssuingCountryCodes) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODES, this.issuingCountryCodes); + } + if (isSetOnlyForCrossBalancePlatform) { + addIfNull( + nulls, JSON_PROPERTY_ONLY_FOR_CROSS_BALANCE_PLATFORM, this.onlyForCrossBalancePlatform); + } + if (isSetPaymentInstrumentType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE, this.paymentInstrumentType); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrumentRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java index 3772295b1..cc487316c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class PaymentInstrumentRevealInfo { public static final String JSON_PROPERTY_CVC = "cvc"; private String cvc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvc = false; + public static final String JSON_PROPERTY_EXPIRATION = "expiration"; private Expiry expiration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiration = false; + public static final String JSON_PROPERTY_PAN = "pan"; private String pan; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPan = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentRevealInfo() {} /** @@ -43,6 +60,7 @@ public PaymentInstrumentRevealInfo() {} */ public PaymentInstrumentRevealInfo cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCvc(String cvc) { */ public PaymentInstrumentRevealInfo expiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set return this; } @@ -99,6 +119,7 @@ public Expiry getExpiration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setExpiration(Expiry expiration) { */ public PaymentInstrumentRevealInfo pan(String pan) { this.pan = pan; + isSetPan = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getPan() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPan(String pan) { this.pan = pan; + isSetPan = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentRevealInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrumentRevealInfo object is equal to o. */ @@ -175,6 +218,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetExpiration) { + addIfNull(nulls, JSON_PROPERTY_EXPIRATION, this.expiration); + } + if (isSetPan) { + addIfNull(nulls, JSON_PROPERTY_PAN, this.pan); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrumentRevealInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealRequest.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealRequest.java index 600da23f1..db4c11381 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class PaymentInstrumentRevealRequest { public static final String JSON_PROPERTY_ENCRYPTED_KEY = "encryptedKey"; private String encryptedKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedKey = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentRevealRequest() {} /** @@ -44,6 +58,7 @@ public PaymentInstrumentRevealRequest() {} */ public PaymentInstrumentRevealRequest encryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set return this; } @@ -75,6 +90,7 @@ public String getEncryptedKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set } /** @@ -88,6 +104,7 @@ public void setEncryptedKey(String encryptedKey) { */ public PaymentInstrumentRevealRequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -115,6 +132,27 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentRevealRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrumentRevealRequest object is equal to o. */ @@ -160,6 +198,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEncryptedKey) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_KEY, this.encryptedKey); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrumentRevealRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealResponse.java index 960d44b62..60fd99d7e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class PaymentInstrumentRevealResponse { public static final String JSON_PROPERTY_ENCRYPTED_DATA = "encryptedData"; private String encryptedData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentRevealResponse() {} /** @@ -34,6 +45,7 @@ public PaymentInstrumentRevealResponse() {} */ public PaymentInstrumentRevealResponse encryptedData(String encryptedData) { this.encryptedData = encryptedData; + isSetEncryptedData = true; // mark as set return this; } @@ -57,6 +69,27 @@ public String getEncryptedData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedData(String encryptedData) { this.encryptedData = encryptedData; + isSetEncryptedData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentRevealResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrumentRevealResponse object is equal to o. */ @@ -97,6 +130,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEncryptedData) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_DATA, this.encryptedData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrumentRevealResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java index 20cb3a261..ebe006423 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,9 +35,15 @@ public class PaymentInstrumentUpdateRequest { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_CARD = "card"; private CardInfo card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + /** * The status of the payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -93,9 +101,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for updating the status of the payment instrument. Possible values: **lost**, * **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, @@ -159,6 +173,15 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentUpdateRequest() {} /** @@ -173,6 +196,7 @@ public PaymentInstrumentUpdateRequest() {} */ public PaymentInstrumentUpdateRequest balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -202,6 +226,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -213,6 +238,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public PaymentInstrumentUpdateRequest card(CardInfo card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -236,6 +262,7 @@ public CardInfo getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(CardInfo card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -262,6 +289,7 @@ public void setCard(CardInfo card) { */ public PaymentInstrumentUpdateRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -315,6 +343,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -328,6 +357,7 @@ public void setStatus(StatusEnum status) { */ public PaymentInstrumentUpdateRequest statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -355,6 +385,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -372,6 +403,7 @@ public void setStatusComment(String statusComment) { */ public PaymentInstrumentUpdateRequest statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -407,6 +439,27 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentUpdateRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentInstrumentUpdateRequest object is equal to o. */ @@ -455,6 +508,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentInstrumentUpdateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Phone.java b/src/main/java/com/adyen/model/balanceplatform/Phone.java index 6d10d0f8e..dd8a6c534 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Phone.java +++ b/src/main/java/com/adyen/model/balanceplatform/Phone.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,6 +29,9 @@ public class Phone { public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + /** Type of phone number. Possible values: **Landline**, **Mobile**. */ public enum TypeEnum { LANDLINE(String.valueOf("landline")), @@ -71,6 +76,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Phone() {} /** @@ -84,6 +98,7 @@ public Phone() {} */ public Phone number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -113,6 +128,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setNumber(String number) { */ public Phone type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Phone includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Phone object is equal to o. */ @@ -186,6 +224,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Phone given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java index cdc93e935..29a158bd8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java +++ b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class PhoneNumber { public static final String JSON_PROPERTY_PHONE_COUNTRY_CODE = "phoneCountryCode"; private String phoneCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneCountryCode = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private String phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + /** The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. */ public enum PhoneTypeEnum { FAX(String.valueOf("Fax")), @@ -82,6 +90,15 @@ public static PhoneTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PHONE_TYPE = "phoneType"; private PhoneTypeEnum phoneType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PhoneNumber() {} /** @@ -94,6 +111,7 @@ public PhoneNumber() {} */ public PhoneNumber phoneCountryCode(String phoneCountryCode) { this.phoneCountryCode = phoneCountryCode; + isSetPhoneCountryCode = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getPhoneCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneCountryCode(String phoneCountryCode) { this.phoneCountryCode = phoneCountryCode; + isSetPhoneCountryCode = true; // mark as set } /** @@ -132,6 +151,7 @@ public void setPhoneCountryCode(String phoneCountryCode) { */ public PhoneNumber phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -157,6 +177,7 @@ public String getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -168,6 +189,7 @@ public void setPhoneNumber(String phoneNumber) { */ public PhoneNumber phoneType(PhoneTypeEnum phoneType) { this.phoneType = phoneType; + isSetPhoneType = true; // mark as set return this; } @@ -193,6 +215,27 @@ public PhoneTypeEnum getPhoneType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneType(PhoneTypeEnum phoneType) { this.phoneType = phoneType; + isSetPhoneType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PhoneNumber includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PhoneNumber object is equal to o. */ @@ -236,6 +279,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPhoneCountryCode) { + addIfNull(nulls, JSON_PROPERTY_PHONE_COUNTRY_CODE, this.phoneCountryCode); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetPhoneType) { + addIfNull(nulls, JSON_PROPERTY_PHONE_TYPE, this.phoneType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PhoneNumber given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PinChangeRequest.java b/src/main/java/com/adyen/model/balanceplatform/PinChangeRequest.java index ccc1df0a2..a8ba6739d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PinChangeRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/PinChangeRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class PinChangeRequest { public static final String JSON_PROPERTY_ENCRYPTED_KEY = "encryptedKey"; private String encryptedKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedKey = false; + public static final String JSON_PROPERTY_ENCRYPTED_PIN_BLOCK = "encryptedPinBlock"; private String encryptedPinBlock; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedPinBlock = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PinChangeRequest() {} /** @@ -51,6 +71,7 @@ public PinChangeRequest() {} */ public PinChangeRequest encryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set return this; } @@ -82,6 +103,7 @@ public String getEncryptedKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set } /** @@ -93,6 +115,7 @@ public void setEncryptedKey(String encryptedKey) { */ public PinChangeRequest encryptedPinBlock(String encryptedPinBlock) { this.encryptedPinBlock = encryptedPinBlock; + isSetEncryptedPinBlock = true; // mark as set return this; } @@ -118,6 +141,7 @@ public String getEncryptedPinBlock() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedPinBlock(String encryptedPinBlock) { this.encryptedPinBlock = encryptedPinBlock; + isSetEncryptedPinBlock = true; // mark as set } /** @@ -130,6 +154,7 @@ public void setEncryptedPinBlock(String encryptedPinBlock) { */ public PinChangeRequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -157,6 +182,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -167,6 +193,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public PinChangeRequest token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -190,6 +217,27 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PinChangeRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PinChangeRequest object is equal to o. */ @@ -237,6 +285,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEncryptedKey) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_KEY, this.encryptedKey); + } + if (isSetEncryptedPinBlock) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_PIN_BLOCK, this.encryptedPinBlock); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PinChangeRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PinChangeResponse.java b/src/main/java/com/adyen/model/balanceplatform/PinChangeResponse.java index e917de51c..10c3c6626 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PinChangeResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PinChangeResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -73,6 +75,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PinChangeResponse() {} /** @@ -85,6 +96,7 @@ public PinChangeResponse() {} */ public PinChangeResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -112,6 +124,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PinChangeResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PinChangeResponse object is equal to o. */ @@ -151,6 +184,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PinChangeResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java index b4cc3b6e1..9109818d1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java +++ b/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class PlatformPaymentConfiguration { public static final String JSON_PROPERTY_SALES_DAY_CLOSING_TIME = "salesDayClosingTime"; private String salesDayClosingTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSalesDayClosingTime = false; + public static final String JSON_PROPERTY_SETTLEMENT_DELAY_DAYS = "settlementDelayDays"; private Integer settlementDelayDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSettlementDelayDays = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PlatformPaymentConfiguration() {} /** @@ -43,6 +57,7 @@ public PlatformPaymentConfiguration() {} */ public PlatformPaymentConfiguration salesDayClosingTime(String salesDayClosingTime) { this.salesDayClosingTime = salesDayClosingTime; + isSetSalesDayClosingTime = true; // mark as set return this; } @@ -74,6 +89,7 @@ public String getSalesDayClosingTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSalesDayClosingTime(String salesDayClosingTime) { this.salesDayClosingTime = salesDayClosingTime; + isSetSalesDayClosingTime = true; // mark as set } /** @@ -87,6 +103,7 @@ public void setSalesDayClosingTime(String salesDayClosingTime) { */ public PlatformPaymentConfiguration settlementDelayDays(Integer settlementDelayDays) { this.settlementDelayDays = settlementDelayDays; + isSetSettlementDelayDays = true; // mark as set return this; } @@ -116,6 +133,27 @@ public Integer getSettlementDelayDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSettlementDelayDays(Integer settlementDelayDays) { this.settlementDelayDays = settlementDelayDays; + isSetSettlementDelayDays = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PlatformPaymentConfiguration includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PlatformPaymentConfiguration object is equal to o. */ @@ -163,6 +201,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSalesDayClosingTime) { + addIfNull(nulls, JSON_PROPERTY_SALES_DAY_CLOSING_TIME, this.salesDayClosingTime); + } + if (isSetSettlementDelayDays) { + addIfNull(nulls, JSON_PROPERTY_SETTLEMENT_DELAY_DAYS, this.settlementDelayDays); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PlatformPaymentConfiguration given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java index c51b0478d..17ca17106 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class ProcessingTypesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { ATMWITHDRAW(String.valueOf("atmWithdraw")), @@ -88,6 +93,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ProcessingTypesRestriction() {} /** @@ -98,6 +112,7 @@ public ProcessingTypesRestriction() {} */ public ProcessingTypesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -121,6 +136,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -133,6 +149,7 @@ public void setOperation(String operation) { */ public ProcessingTypesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -168,6 +185,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ProcessingTypesRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ProcessingTypesRestriction object is equal to o. */ @@ -209,6 +247,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ProcessingTypesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PublicKeyResponse.java b/src/main/java/com/adyen/model/balanceplatform/PublicKeyResponse.java index 1e4eccac7..1743fe563 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PublicKeyResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PublicKeyResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class PublicKeyResponse { public static final String JSON_PROPERTY_PUBLIC_KEY = "publicKey"; private String publicKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPublicKey = false; + public static final String JSON_PROPERTY_PUBLIC_KEY_EXPIRY_DATE = "publicKeyExpiryDate"; private String publicKeyExpiryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPublicKeyExpiryDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PublicKeyResponse() {} /** @@ -39,6 +53,7 @@ public PublicKeyResponse() {} */ public PublicKeyResponse publicKey(String publicKey) { this.publicKey = publicKey; + isSetPublicKey = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getPublicKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPublicKey(String publicKey) { this.publicKey = publicKey; + isSetPublicKey = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setPublicKey(String publicKey) { */ public PublicKeyResponse publicKeyExpiryDate(String publicKeyExpiryDate) { this.publicKeyExpiryDate = publicKeyExpiryDate; + isSetPublicKeyExpiryDate = true; // mark as set return this; } @@ -95,6 +112,27 @@ public String getPublicKeyExpiryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPublicKeyExpiryDate(String publicKeyExpiryDate) { this.publicKeyExpiryDate = publicKeyExpiryDate; + isSetPublicKeyExpiryDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PublicKeyResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PublicKeyResponse object is equal to o. */ @@ -138,6 +176,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPublicKey) { + addIfNull(nulls, JSON_PROPERTY_PUBLIC_KEY, this.publicKey); + } + if (isSetPublicKeyExpiryDate) { + addIfNull(nulls, JSON_PROPERTY_PUBLIC_KEY_EXPIRY_DATE, this.publicKeyExpiryDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PublicKeyResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RegisterSCAFinalResponse.java b/src/main/java/com/adyen/model/balanceplatform/RegisterSCAFinalResponse.java index 564b53724..75d59552e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RegisterSCAFinalResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/RegisterSCAFinalResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class RegisterSCAFinalResponse { public static final String JSON_PROPERTY_SUCCESS = "success"; private Boolean success; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuccess = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RegisterSCAFinalResponse() {} /** @@ -33,6 +44,7 @@ public RegisterSCAFinalResponse() {} */ public RegisterSCAFinalResponse success(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Boolean getSuccess() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuccess(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RegisterSCAFinalResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RegisterSCAFinalResponse object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSuccess) { + addIfNull(nulls, JSON_PROPERTY_SUCCESS, this.success); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RegisterSCAFinalResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RegisterSCARequest.java b/src/main/java/com/adyen/model/balanceplatform/RegisterSCARequest.java index 31167cc89..7f64473ff 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RegisterSCARequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/RegisterSCARequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,13 +29,28 @@ public class RegisterSCARequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_STRONG_CUSTOMER_AUTHENTICATION = "strongCustomerAuthentication"; private DelegatedAuthenticationData strongCustomerAuthentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStrongCustomerAuthentication = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RegisterSCARequest() {} /** @@ -47,6 +64,7 @@ public RegisterSCARequest() {} */ public RegisterSCARequest name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -76,6 +94,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -87,6 +106,7 @@ public void setName(String name) { */ public RegisterSCARequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -112,6 +132,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -123,6 +144,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { public RegisterSCARequest strongCustomerAuthentication( DelegatedAuthenticationData strongCustomerAuthentication) { this.strongCustomerAuthentication = strongCustomerAuthentication; + isSetStrongCustomerAuthentication = true; // mark as set return this; } @@ -147,6 +169,27 @@ public DelegatedAuthenticationData getStrongCustomerAuthentication() { public void setStrongCustomerAuthentication( DelegatedAuthenticationData strongCustomerAuthentication) { this.strongCustomerAuthentication = strongCustomerAuthentication; + isSetStrongCustomerAuthentication = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RegisterSCARequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RegisterSCARequest object is equal to o. */ @@ -195,6 +238,37 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetStrongCustomerAuthentication) { + addIfNull( + nulls, JSON_PROPERTY_STRONG_CUSTOMER_AUTHENTICATION, this.strongCustomerAuthentication); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RegisterSCARequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RegisterSCAResponse.java b/src/main/java/com/adyen/model/balanceplatform/RegisterSCAResponse.java index 8f491a766..bd75c1e0e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RegisterSCAResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/RegisterSCAResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class RegisterSCAResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_SDK_INPUT = "sdkInput"; private String sdkInput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInput = false; + public static final String JSON_PROPERTY_SUCCESS = "success"; private Boolean success; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuccess = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RegisterSCAResponse() {} /** @@ -47,6 +67,7 @@ public RegisterSCAResponse() {} */ public RegisterSCAResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -81,6 +103,7 @@ public void setId(String id) { */ public RegisterSCAResponse paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -106,6 +129,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -118,6 +142,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public RegisterSCAResponse sdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set return this; } @@ -145,6 +170,7 @@ public String getSdkInput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set } /** @@ -155,6 +181,7 @@ public void setSdkInput(String sdkInput) { */ public RegisterSCAResponse success(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set return this; } @@ -178,6 +205,27 @@ public Boolean getSuccess() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuccess(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RegisterSCAResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RegisterSCAResponse object is equal to o. */ @@ -225,6 +273,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetSdkInput) { + addIfNull(nulls, JSON_PROPERTY_SDK_INPUT, this.sdkInput); + } + if (isSetSuccess) { + addIfNull(nulls, JSON_PROPERTY_SUCCESS, this.success); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RegisterSCAResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java b/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java index 70aba6fbc..7ff4fc8fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java +++ b/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class RemediatingAction { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RemediatingAction() {} /** @@ -36,6 +50,7 @@ public RemediatingAction() {} */ public RemediatingAction code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCode(String code) { */ public RemediatingAction message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RemediatingAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RemediatingAction object is equal to o. */ @@ -133,6 +171,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RemediatingAction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RemoveAssociationRequest.java b/src/main/java/com/adyen/model/balanceplatform/RemoveAssociationRequest.java index db98f637e..9334b7aa8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RemoveAssociationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/RemoveAssociationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,12 +31,27 @@ public class RemoveAssociationRequest { public static final String JSON_PROPERTY_ENTITY_ID = "entityId"; private String entityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private ScaEntityType entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_SCA_DEVICE_IDS = "scaDeviceIds"; private List scaDeviceIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RemoveAssociationRequest() {} /** @@ -45,6 +62,7 @@ public RemoveAssociationRequest() {} */ public RemoveAssociationRequest entityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set return this; } @@ -68,6 +86,7 @@ public String getEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set } /** @@ -78,6 +97,7 @@ public void setEntityId(String entityId) { */ public RemoveAssociationRequest entityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -101,6 +121,7 @@ public ScaEntityType getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -111,6 +132,7 @@ public void setEntityType(ScaEntityType entityType) { */ public RemoveAssociationRequest scaDeviceIds(List scaDeviceIds) { this.scaDeviceIds = scaDeviceIds; + isSetScaDeviceIds = true; // mark as set return this; } @@ -142,6 +164,27 @@ public List getScaDeviceIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceIds(List scaDeviceIds) { this.scaDeviceIds = scaDeviceIds; + isSetScaDeviceIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RemoveAssociationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RemoveAssociationRequest object is equal to o. */ @@ -185,6 +228,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntityId) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ID, this.entityId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetScaDeviceIds) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_IDS, this.scaDeviceIds); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RemoveAssociationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Repayment.java b/src/main/java/com/adyen/model/balanceplatform/Repayment.java index aa2f906c7..8ab629b6e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Repayment.java +++ b/src/main/java/com/adyen/model/balanceplatform/Repayment.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class Repayment { public static final String JSON_PROPERTY_BASIS_POINTS = "basisPoints"; private Integer basisPoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasisPoints = false; + public static final String JSON_PROPERTY_TERM = "term"; private RepaymentTerm term; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTerm = false; + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; private ThresholdRepayment threshold; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreshold = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Repayment() {} /** @@ -45,6 +62,7 @@ public Repayment() {} */ public Repayment basisPoints(Integer basisPoints) { this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set return this; } @@ -72,6 +90,7 @@ public Integer getBasisPoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasisPoints(Integer basisPoints) { this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setBasisPoints(Integer basisPoints) { */ public Repayment term(RepaymentTerm term) { this.term = term; + isSetTerm = true; // mark as set return this; } @@ -105,6 +125,7 @@ public RepaymentTerm getTerm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTerm(RepaymentTerm term) { this.term = term; + isSetTerm = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setTerm(RepaymentTerm term) { */ public Repayment threshold(ThresholdRepayment threshold) { this.threshold = threshold; + isSetThreshold = true; // mark as set return this; } @@ -138,6 +160,27 @@ public ThresholdRepayment getThreshold() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreshold(ThresholdRepayment threshold) { this.threshold = threshold; + isSetThreshold = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Repayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Repayment object is equal to o. */ @@ -181,6 +224,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBasisPoints) { + addIfNull(nulls, JSON_PROPERTY_BASIS_POINTS, this.basisPoints); + } + if (isSetTerm) { + addIfNull(nulls, JSON_PROPERTY_TERM, this.term); + } + if (isSetThreshold) { + addIfNull(nulls, JSON_PROPERTY_THRESHOLD, this.threshold); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Repayment given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java index 66ff77e61..85ad8f1fd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java +++ b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class RepaymentTerm { public static final String JSON_PROPERTY_ESTIMATED_DAYS = "estimatedDays"; private Integer estimatedDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedDays = false; + public static final String JSON_PROPERTY_MAXIMUM_DAYS = "maximumDays"; private Integer maximumDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaximumDays = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RepaymentTerm() {} /** @@ -39,6 +53,7 @@ public RepaymentTerm() {} */ public RepaymentTerm estimatedDays(Integer estimatedDays) { this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set return this; } @@ -62,6 +77,7 @@ public Integer getEstimatedDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedDays(Integer estimatedDays) { this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEstimatedDays(Integer estimatedDays) { */ public RepaymentTerm maximumDays(Integer maximumDays) { this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set return this; } @@ -101,6 +118,27 @@ public Integer getMaximumDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaximumDays(Integer maximumDays) { this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RepaymentTerm includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RepaymentTerm object is equal to o. */ @@ -142,6 +180,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEstimatedDays) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_DAYS, this.estimatedDays); + } + if (isSetMaximumDays) { + addIfNull(nulls, JSON_PROPERTY_MAXIMUM_DAYS, this.maximumDays); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RepaymentTerm given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java index 02871dfeb..c46605d11 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java +++ b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,30 +37,63 @@ public class RestServiceError { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + public static final String JSON_PROPERTY_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_RESPONSE = "response"; private Object response; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RestServiceError() {} /** @@ -69,6 +104,7 @@ public RestServiceError() {} */ public RestServiceError detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -92,6 +128,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -102,6 +139,7 @@ public void setDetail(String detail) { */ public RestServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -125,6 +163,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -135,6 +174,7 @@ public void setErrorCode(String errorCode) { */ public RestServiceError instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -158,6 +198,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -168,6 +209,7 @@ public void setInstance(String instance) { */ public RestServiceError invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -199,6 +241,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -210,6 +253,7 @@ public void setInvalidFields(List invalidFields) { */ public RestServiceError requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -235,6 +279,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -245,6 +290,7 @@ public void setRequestId(String requestId) { */ public RestServiceError response(Object response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -268,6 +314,7 @@ public Object getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(Object response) { this.response = response; + isSetResponse = true; // mark as set } /** @@ -278,6 +325,7 @@ public void setResponse(Object response) { */ public RestServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -301,6 +349,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -311,6 +360,7 @@ public void setStatus(Integer status) { */ public RestServiceError title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -334,6 +384,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -346,6 +397,7 @@ public void setTitle(String title) { */ public RestServiceError type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -373,6 +425,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RestServiceError includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RestServiceError object is equal to o. */ @@ -429,6 +502,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RestServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RevealPinRequest.java b/src/main/java/com/adyen/model/balanceplatform/RevealPinRequest.java index ea1075b73..9332aecec 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RevealPinRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/RevealPinRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class RevealPinRequest { public static final String JSON_PROPERTY_ENCRYPTED_KEY = "encryptedKey"; private String encryptedKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedKey = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RevealPinRequest() {} /** @@ -43,6 +57,7 @@ public RevealPinRequest() {} */ public RevealPinRequest encryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set return this; } @@ -74,6 +89,7 @@ public String getEncryptedKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set } /** @@ -86,6 +102,7 @@ public void setEncryptedKey(String encryptedKey) { */ public RevealPinRequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RevealPinRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RevealPinRequest object is equal to o. */ @@ -156,6 +194,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEncryptedKey) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_KEY, this.encryptedKey); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RevealPinRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RevealPinResponse.java b/src/main/java/com/adyen/model/balanceplatform/RevealPinResponse.java index 395dcab77..98b06871f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RevealPinResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/RevealPinResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class RevealPinResponse { public static final String JSON_PROPERTY_ENCRYPTED_PIN_BLOCK = "encryptedPinBlock"; private String encryptedPinBlock; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedPinBlock = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RevealPinResponse() {} /** @@ -40,6 +54,7 @@ public RevealPinResponse() {} */ public RevealPinResponse encryptedPinBlock(String encryptedPinBlock) { this.encryptedPinBlock = encryptedPinBlock; + isSetEncryptedPinBlock = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getEncryptedPinBlock() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedPinBlock(String encryptedPinBlock) { this.encryptedPinBlock = encryptedPinBlock; + isSetEncryptedPinBlock = true; // mark as set } /** @@ -75,6 +91,7 @@ public void setEncryptedPinBlock(String encryptedPinBlock) { */ public RevealPinResponse token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -98,6 +115,27 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RevealPinResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RevealPinResponse object is equal to o. */ @@ -139,6 +177,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEncryptedPinBlock) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_PIN_BLOCK, this.encryptedPinBlock); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RevealPinResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RiskScores.java b/src/main/java/com/adyen/model/balanceplatform/RiskScores.java index 6e1742123..a4fe03239 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RiskScores.java +++ b/src/main/java/com/adyen/model/balanceplatform/RiskScores.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class RiskScores { public static final String JSON_PROPERTY_MASTERCARD = "mastercard"; private Integer mastercard; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMastercard = false; + public static final String JSON_PROPERTY_VISA = "visa"; private Integer visa; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVisa = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RiskScores() {} /** @@ -38,6 +52,7 @@ public RiskScores() {} */ public RiskScores mastercard(Integer mastercard) { this.mastercard = mastercard; + isSetMastercard = true; // mark as set return this; } @@ -65,6 +80,7 @@ public Integer getMastercard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMastercard(Integer mastercard) { this.mastercard = mastercard; + isSetMastercard = true; // mark as set } /** @@ -77,6 +93,7 @@ public void setMastercard(Integer mastercard) { */ public RiskScores visa(Integer visa) { this.visa = visa; + isSetVisa = true; // mark as set return this; } @@ -104,6 +121,27 @@ public Integer getVisa() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVisa(Integer visa) { this.visa = visa; + isSetVisa = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RiskScores includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RiskScores object is equal to o. */ @@ -145,6 +183,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMastercard) { + addIfNull(nulls, JSON_PROPERTY_MASTERCARD, this.mastercard); + } + if (isSetVisa) { + addIfNull(nulls, JSON_PROPERTY_VISA, this.visa); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RiskScores given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RiskScoresRestriction.java b/src/main/java/com/adyen/model/balanceplatform/RiskScoresRestriction.java index 46afd17bb..4f74d6c89 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RiskScoresRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/RiskScoresRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class RiskScoresRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private RiskScores value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RiskScoresRestriction() {} /** @@ -39,6 +53,7 @@ public RiskScoresRestriction() {} */ public RiskScoresRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public RiskScoresRestriction value(RiskScores value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public RiskScores getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(RiskScores value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RiskScoresRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RiskScoresRestriction object is equal to o. */ @@ -136,6 +174,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RiskScoresRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java index a316850d9..478cd28d7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class SELocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; private String clearingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + /** **seLocal** */ public enum TypeEnum { SELOCAL(String.valueOf("seLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SELocalAccountIdentification() {} /** @@ -90,6 +107,7 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -135,6 +154,7 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SELocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SELocalAccountIdentification object is equal to o. */ @@ -242,6 +285,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java index 0d9892271..b6375ce45 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class SGLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **sgLocal** */ public enum TypeEnum { SGLOCAL(String.valueOf("sgLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SGLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -142,6 +162,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -152,6 +173,7 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +197,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SGLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SGLocalAccountIdentification object is equal to o. */ @@ -218,6 +261,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SameAmountRestriction.java b/src/main/java/com/adyen/model/balanceplatform/SameAmountRestriction.java index 907568935..7e9359e63 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SameAmountRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/SameAmountRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class SameAmountRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Boolean value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SameAmountRestriction() {} /** @@ -39,6 +53,7 @@ public SameAmountRestriction() {} */ public SameAmountRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public SameAmountRestriction value(Boolean value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Boolean getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Boolean value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SameAmountRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SameAmountRestriction object is equal to o. */ @@ -136,6 +174,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SameAmountRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SameCounterpartyRestriction.java b/src/main/java/com/adyen/model/balanceplatform/SameCounterpartyRestriction.java index 995cdf7da..6ff5c4d10 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SameCounterpartyRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/SameCounterpartyRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class SameCounterpartyRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Boolean value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SameCounterpartyRestriction() {} /** @@ -39,6 +53,7 @@ public SameCounterpartyRestriction() {} */ public SameCounterpartyRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public SameCounterpartyRestriction value(Boolean value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Boolean getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Boolean value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SameCounterpartyRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SameCounterpartyRestriction object is equal to o. */ @@ -136,6 +174,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SameCounterpartyRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaDevice.java b/src/main/java/com/adyen/model/balanceplatform/ScaDevice.java index 774e5178d..2ddd19882 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaDevice.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaDevice.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ScaDevice { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_TYPE = "type"; private ScaDeviceType type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ScaDevice() {} /** @@ -43,6 +60,7 @@ public ScaDevice() {} */ public ScaDevice id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -78,6 +97,7 @@ public void setId(String id) { */ public ScaDevice name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -105,6 +125,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setName(String name) { */ public ScaDevice type(ScaDeviceType type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +160,27 @@ public ScaDeviceType getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(ScaDeviceType type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ScaDevice includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ScaDevice object is equal to o. */ @@ -181,6 +224,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ScaDevice given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaEntity.java b/src/main/java/com/adyen/model/balanceplatform/ScaEntity.java index 67442f106..dde090b6a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaEntity.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class ScaEntity { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private ScaEntityType type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ScaEntity() {} /** @@ -36,6 +50,7 @@ public ScaEntity() {} */ public ScaEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setId(String id) { */ public ScaEntity type(ScaEntityType type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -92,6 +109,27 @@ public ScaEntityType getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(ScaEntityType type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ScaEntity includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ScaEntity object is equal to o. */ @@ -132,6 +170,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ScaEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaInformation.java b/src/main/java/com/adyen/model/balanceplatform/ScaInformation.java index 8572ebad0..8e79696fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaInformation.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class ScaInformation { public static final String JSON_PROPERTY_EXEMPTION = "exemption"; private ScaExemption exemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExemption = false; + public static final String JSON_PROPERTY_STATUS = "status"; private ScaStatus status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ScaInformation() {} /** @@ -36,6 +50,7 @@ public ScaInformation() {} */ public ScaInformation exemption(ScaExemption exemption) { this.exemption = exemption; + isSetExemption = true; // mark as set return this; } @@ -59,6 +74,7 @@ public ScaExemption getExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemption(ScaExemption exemption) { this.exemption = exemption; + isSetExemption = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setExemption(ScaExemption exemption) { */ public ScaInformation status(ScaStatus status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -92,6 +109,27 @@ public ScaStatus getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(ScaStatus status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ScaInformation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ScaInformation object is equal to o. */ @@ -133,6 +171,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExemption) { + addIfNull(nulls, JSON_PROPERTY_EXEMPTION, this.exemption); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ScaInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SearchRegisteredDevicesResponse.java b/src/main/java/com/adyen/model/balanceplatform/SearchRegisteredDevicesResponse.java index 099cdc84f..9a7dd6a75 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SearchRegisteredDevicesResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/SearchRegisteredDevicesResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,15 +32,33 @@ public class SearchRegisteredDevicesResponse { public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ITEMS_TOTAL = "itemsTotal"; private Integer itemsTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemsTotal = false; + public static final String JSON_PROPERTY_LINK = "link"; private Link link; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLink = false; + public static final String JSON_PROPERTY_PAGES_TOTAL = "pagesTotal"; private Integer pagesTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPagesTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SearchRegisteredDevicesResponse() {} /** @@ -50,6 +70,7 @@ public SearchRegisteredDevicesResponse() {} */ public SearchRegisteredDevicesResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -81,6 +102,7 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set } /** @@ -92,6 +114,7 @@ public void setData(List data) { */ public SearchRegisteredDevicesResponse itemsTotal(Integer itemsTotal) { this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set return this; } @@ -115,6 +138,7 @@ public Integer getItemsTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItemsTotal(Integer itemsTotal) { this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setItemsTotal(Integer itemsTotal) { */ public SearchRegisteredDevicesResponse link(Link link) { this.link = link; + isSetLink = true; // mark as set return this; } @@ -149,6 +174,7 @@ public Link getLink() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLink(Link link) { this.link = link; + isSetLink = true; // mark as set } /** @@ -160,6 +186,7 @@ public void setLink(Link link) { */ public SearchRegisteredDevicesResponse pagesTotal(Integer pagesTotal) { this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set return this; } @@ -183,6 +210,27 @@ public Integer getPagesTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPagesTotal(Integer pagesTotal) { this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SearchRegisteredDevicesResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SearchRegisteredDevicesResponse object is equal to o. */ @@ -229,6 +277,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetItemsTotal) { + addIfNull(nulls, JSON_PROPERTY_ITEMS_TOTAL, this.itemsTotal); + } + if (isSetLink) { + addIfNull(nulls, JSON_PROPERTY_LINK, this.link); + } + if (isSetPagesTotal) { + addIfNull(nulls, JSON_PROPERTY_PAGES_TOTAL, this.pagesTotal); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SearchRegisteredDevicesResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SourceAccountTypesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/SourceAccountTypesRestriction.java index b8f3fcb1f..bd30a88fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SourceAccountTypesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/SourceAccountTypesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class SourceAccountTypesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { BALANCEACCOUNT(String.valueOf("balanceAccount")), @@ -76,6 +81,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SourceAccountTypesRestriction() {} /** @@ -87,6 +101,7 @@ public SourceAccountTypesRestriction() {} */ public SourceAccountTypesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -110,6 +125,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setOperation(String operation) { */ public SourceAccountTypesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -152,6 +169,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SourceAccountTypesRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SourceAccountTypesRestriction object is equal to o. */ @@ -193,6 +231,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SourceAccountTypesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java index 9c2f29d09..e06c192dd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java +++ b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -75,9 +77,21 @@ public static OperationEnum fromValue(String value) { public static final String JSON_PROPERTY_OPERATION = "operation"; private OperationEnum operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StringMatch() {} /** @@ -90,6 +104,7 @@ public StringMatch() {} */ public StringMatch operation(OperationEnum operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -117,6 +132,7 @@ public OperationEnum getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(OperationEnum operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setOperation(OperationEnum operation) { */ public StringMatch value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -150,6 +167,27 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StringMatch includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this StringMatch object is equal to o. */ @@ -191,6 +229,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of StringMatch given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationRequest.java b/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationRequest.java index a52b29041..0c874107a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class SubmitScaAssociationRequest { public static final String JSON_PROPERTY_ENTITIES = "entities"; private List entities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntities = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubmitScaAssociationRequest() {} /** @@ -35,6 +46,7 @@ public SubmitScaAssociationRequest() {} */ public SubmitScaAssociationRequest entities(List entities) { this.entities = entities; + isSetEntities = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getEntities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntities(List entities) { this.entities = entities; + isSetEntities = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubmitScaAssociationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SubmitScaAssociationRequest object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntities) { + addIfNull(nulls, JSON_PROPERTY_ENTITIES, this.entities); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SubmitScaAssociationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationResponse.java b/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationResponse.java index 3de49bf54..89aa4d069 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class SubmitScaAssociationResponse { public static final String JSON_PROPERTY_SCA_ASSOCIATIONS = "scaAssociations"; private List scaAssociations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaAssociations = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubmitScaAssociationResponse() {} /** @@ -35,6 +46,7 @@ public SubmitScaAssociationResponse() {} */ public SubmitScaAssociationResponse scaAssociations(List scaAssociations) { this.scaAssociations = scaAssociations; + isSetScaAssociations = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getScaAssociations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaAssociations(List scaAssociations) { this.scaAssociations = scaAssociations; + isSetScaAssociations = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubmitScaAssociationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SubmitScaAssociationResponse object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetScaAssociations) { + addIfNull(nulls, JSON_PROPERTY_SCA_ASSOCIATIONS, this.scaAssociations); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SubmitScaAssociationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java index 08b97b895..c0b26eabd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -96,18 +98,33 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private SweepCounterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -160,6 +177,9 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** The reason for disabling the sweep. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -209,6 +229,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -251,18 +273,33 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REASON_DETAIL = "reasonDetail"; private String reasonDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReasonDetail = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; private SweepSchedule schedule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + /** * The status of the sweep. If not provided, by default, this is set to **active**. Possible * values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on @@ -311,15 +348,27 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_SWEEP_AMOUNT = "sweepAmount"; private Amount sweepAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweepAmount = false; + public static final String JSON_PROPERTY_TARGET_AMOUNT = "targetAmount"; private Amount targetAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAmount = false; + public static final String JSON_PROPERTY_TRIGGER_AMOUNT = "triggerAmount"; private Amount triggerAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggerAmount = false; + /** * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not * provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to @@ -369,6 +418,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SweepConfigurationV2() {} @JsonCreator @@ -400,6 +458,7 @@ public SweepConfigurationV2( */ public SweepConfigurationV2 category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -443,6 +502,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -453,6 +513,7 @@ public void setCategory(CategoryEnum category) { */ public SweepConfigurationV2 counterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -476,6 +537,7 @@ public SweepCounterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -492,6 +554,7 @@ public void setCounterparty(SweepCounterparty counterparty) { */ public SweepConfigurationV2 currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -527,6 +590,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -541,6 +605,7 @@ public void setCurrency(String currency) { */ public SweepConfigurationV2 description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -572,6 +637,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -594,14 +660,14 @@ public String getId() { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -617,14 +683,14 @@ public String getId() { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -634,6 +700,7 @@ public String getId() { */ public SweepConfigurationV2 priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -654,14 +721,14 @@ public SweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesItem) { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -677,14 +744,14 @@ public SweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesItem) { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -706,14 +773,14 @@ public List getPriorities() { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -729,14 +796,14 @@ public List getPriorities() { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -747,6 +814,7 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** @@ -779,6 +847,7 @@ public String getReasonDetail() { */ public SweepConfigurationV2 reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -802,6 +871,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -814,6 +884,7 @@ public void setReference(String reference) { */ public SweepConfigurationV2 referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -841,6 +912,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -851,6 +923,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public SweepConfigurationV2 schedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set return this; } @@ -874,6 +947,7 @@ public SweepSchedule getSchedule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set } /** @@ -889,6 +963,7 @@ public void setSchedule(SweepSchedule schedule) { */ public SweepConfigurationV2 status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -922,6 +997,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -932,6 +1008,7 @@ public void setStatus(StatusEnum status) { */ public SweepConfigurationV2 sweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set return this; } @@ -955,6 +1032,7 @@ public Amount getSweepAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set } /** @@ -965,6 +1043,7 @@ public void setSweepAmount(Amount sweepAmount) { */ public SweepConfigurationV2 targetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set return this; } @@ -988,6 +1067,7 @@ public Amount getTargetAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set } /** @@ -998,6 +1078,7 @@ public void setTargetAmount(Amount targetAmount) { */ public SweepConfigurationV2 triggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set return this; } @@ -1021,6 +1102,7 @@ public Amount getTriggerAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTriggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set } /** @@ -1037,6 +1119,7 @@ public void setTriggerAmount(Amount triggerAmount) { */ public SweepConfigurationV2 type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1072,6 +1155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SweepConfigurationV2 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SweepConfigurationV2 object is equal to o. */ @@ -1160,6 +1264,75 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReasonDetail) { + addIfNull(nulls, JSON_PROPERTY_REASON_DETAIL, this.reasonDetail); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSweepAmount) { + addIfNull(nulls, JSON_PROPERTY_SWEEP_AMOUNT, this.sweepAmount); + } + if (isSetTargetAmount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_AMOUNT, this.targetAmount); + } + if (isSetTriggerAmount) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER_AMOUNT, this.triggerAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SweepConfigurationV2 given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java b/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java index e12f86ab6..9d595ec17 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class SweepCounterparty { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SweepCounterparty() {} /** @@ -49,6 +66,7 @@ public SweepCounterparty() {} */ public SweepCounterparty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -84,6 +102,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -97,6 +116,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public SweepCounterparty merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -126,6 +146,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -155,6 +176,7 @@ public void setMerchantAccount(String merchantAccount) { */ public SweepCounterparty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -216,6 +238,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SweepCounterparty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SweepCounterparty object is equal to o. */ @@ -261,6 +304,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SweepCounterparty given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java index 7b309ae0b..f9c4445a4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,6 +29,9 @@ public class SweepSchedule { public static final String JSON_PROPERTY_CRON_EXPRESSION = "cronExpression"; private String cronExpression; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCronExpression = false; + /** * The schedule type. Possible values: * **cron**: push out funds based on a * `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: @@ -83,6 +88,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SweepSchedule() {} /** @@ -108,6 +122,7 @@ public SweepSchedule() {} */ public SweepSchedule cronExpression(String cronExpression) { this.cronExpression = cronExpression; + isSetCronExpression = true; // mark as set return this; } @@ -161,6 +176,7 @@ public String getCronExpression() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCronExpression(String cronExpression) { this.cronExpression = cronExpression; + isSetCronExpression = true; // mark as set } /** @@ -179,6 +195,7 @@ public void setCronExpression(String cronExpression) { */ public SweepSchedule type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -218,6 +235,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SweepSchedule includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SweepSchedule object is equal to o. */ @@ -259,6 +297,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCronExpression) { + addIfNull(nulls, JSON_PROPERTY_CRON_EXPRESSION, this.cronExpression); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SweepSchedule given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Target.java b/src/main/java/com/adyen/model/balanceplatform/Target.java index f88f96c2a..fddb9436b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Target.java +++ b/src/main/java/com/adyen/model/balanceplatform/Target.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,6 +29,9 @@ public class Target { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** * The resource for which you want to receive notifications. Possible values: * * **balancePlatform**: receive notifications about balance changes in your entire balance @@ -79,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Target() {} /** @@ -91,6 +105,7 @@ public Target() {} */ public Target id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -118,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -136,6 +152,7 @@ public void setId(String id) { */ public Target type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +192,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Target includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Target object is equal to o. */ @@ -215,6 +253,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Target given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TargetUpdate.java b/src/main/java/com/adyen/model/balanceplatform/TargetUpdate.java index 240936b7b..df019fe8e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TargetUpdate.java +++ b/src/main/java/com/adyen/model/balanceplatform/TargetUpdate.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,6 +29,9 @@ public class TargetUpdate { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** * The resource for which you want to receive notifications. Possible values: * * **balancePlatform**: receive notifications about balance changes in your entire balance @@ -79,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TargetUpdate() {} /** @@ -91,6 +105,7 @@ public TargetUpdate() {} */ public TargetUpdate id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -118,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -136,6 +152,7 @@ public void setId(String id) { */ public TargetUpdate type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +192,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TargetUpdate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TargetUpdate object is equal to o. */ @@ -215,6 +253,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TargetUpdate given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java index 591e826a3..bb402ba29 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java +++ b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class ThresholdRepayment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThresholdRepayment() {} /** @@ -33,6 +44,7 @@ public ThresholdRepayment() {} */ public ThresholdRepayment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThresholdRepayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThresholdRepayment object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThresholdRepayment given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java b/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java index f975493f6..43c33b979 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java +++ b/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class TimeOfDay { public static final String JSON_PROPERTY_END_TIME = "endTime"; private String endTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndTime = false; + public static final String JSON_PROPERTY_START_TIME = "startTime"; private String startTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartTime = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TimeOfDay() {} /** @@ -38,6 +52,7 @@ public TimeOfDay() {} */ public TimeOfDay endTime(String endTime) { this.endTime = endTime; + isSetEndTime = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getEndTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndTime(String endTime) { this.endTime = endTime; + isSetEndTime = true; // mark as set } /** @@ -77,6 +93,7 @@ public void setEndTime(String endTime) { */ public TimeOfDay startTime(String startTime) { this.startTime = startTime; + isSetStartTime = true; // mark as set return this; } @@ -104,6 +121,27 @@ public String getStartTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartTime(String startTime) { this.startTime = startTime; + isSetStartTime = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TimeOfDay includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TimeOfDay object is equal to o. */ @@ -145,6 +183,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEndTime) { + addIfNull(nulls, JSON_PROPERTY_END_TIME, this.endTime); + } + if (isSetStartTime) { + addIfNull(nulls, JSON_PROPERTY_START_TIME, this.startTime); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TimeOfDay given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java index 0bed38d2a..23849ff60 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TimeOfDayRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private TimeOfDay value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TimeOfDayRestriction() {} /** @@ -39,6 +53,7 @@ public TimeOfDayRestriction() {} */ public TimeOfDayRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public TimeOfDayRestriction value(TimeOfDay value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public TimeOfDay getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(TimeOfDay value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TimeOfDayRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TimeOfDayRestriction object is equal to o. */ @@ -136,6 +174,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TimeOfDayRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TokenRequestorsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TokenRequestorsRestriction.java index bb4db99db..f0a0cae61 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TokenRequestorsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TokenRequestorsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class TokenRequestorsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TokenRequestorsRestriction() {} /** @@ -41,6 +55,7 @@ public TokenRequestorsRestriction() {} */ public TokenRequestorsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public TokenRequestorsRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TokenRequestorsRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TokenRequestorsRestriction object is equal to o. */ @@ -146,6 +184,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TokenRequestorsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java index 6327e440f..920250e26 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TotalAmountRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Amount value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TotalAmountRestriction() {} /** @@ -39,6 +53,7 @@ public TotalAmountRestriction() {} */ public TotalAmountRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public TotalAmountRestriction value(Amount value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Amount getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Amount value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TotalAmountRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TotalAmountRestriction object is equal to o. */ @@ -136,6 +174,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TotalAmountRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java index 55cbd7732..2565efb38 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,21 +44,39 @@ public class TransactionRule { public static final String JSON_PROPERTY_AGGREGATION_LEVEL = "aggregationLevel"; private String aggregationLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAggregationLevel = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_END_DATE = "endDate"; private String endDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndDate = false; + public static final String JSON_PROPERTY_ENTITY_KEY = "entityKey"; private TransactionRuleEntityKey entityKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityKey = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INTERVAL = "interval"; private TransactionRuleInterval interval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterval = false; + /** * The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied * when a transaction meets the conditions of the rule. Possible values: * **hardBlock** @@ -115,9 +135,15 @@ public static OutcomeTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private OutcomeTypeEnum outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * Indicates the type of request to which the rule applies. If not provided, by default, this is * set to **authorization**. Possible values: **authorization**, **authentication**, @@ -170,15 +196,27 @@ public static RequestTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUEST_TYPE = "requestType"; private RequestTypeEnum requestType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestType = false; + public static final String JSON_PROPERTY_RULE_RESTRICTIONS = "ruleRestrictions"; private TransactionRuleRestrictions ruleRestrictions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRuleRestrictions = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_START_DATE = "startDate"; private String startDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartDate = false; + /** * The status of the transaction rule. If you provide a `startDate` in the request, the * rule is automatically created with an **active** status. Possible values: **active**, @@ -227,6 +265,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines * if a rule blocks transactions based on individual characteristics or accumulates data. Possible @@ -283,6 +324,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRule() {} /** @@ -303,6 +353,7 @@ public TransactionRule() {} */ public TransactionRule aggregationLevel(String aggregationLevel) { this.aggregationLevel = aggregationLevel; + isSetAggregationLevel = true; // mark as set return this; } @@ -346,6 +397,7 @@ public String getAggregationLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAggregationLevel(String aggregationLevel) { this.aggregationLevel = aggregationLevel; + isSetAggregationLevel = true; // mark as set } /** @@ -356,6 +408,7 @@ public void setAggregationLevel(String aggregationLevel) { */ public TransactionRule description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -379,6 +432,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -393,6 +447,7 @@ public void setDescription(String description) { */ public TransactionRule endDate(String endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set return this; } @@ -424,6 +479,7 @@ public String getEndDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndDate(String endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set } /** @@ -434,6 +490,7 @@ public void setEndDate(String endDate) { */ public TransactionRule entityKey(TransactionRuleEntityKey entityKey) { this.entityKey = entityKey; + isSetEntityKey = true; // mark as set return this; } @@ -457,6 +514,7 @@ public TransactionRuleEntityKey getEntityKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityKey(TransactionRuleEntityKey entityKey) { this.entityKey = entityKey; + isSetEntityKey = true; // mark as set } /** @@ -467,6 +525,7 @@ public void setEntityKey(TransactionRuleEntityKey entityKey) { */ public TransactionRule id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -490,6 +549,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -500,6 +560,7 @@ public void setId(String id) { */ public TransactionRule interval(TransactionRuleInterval interval) { this.interval = interval; + isSetInterval = true; // mark as set return this; } @@ -523,6 +584,7 @@ public TransactionRuleInterval getInterval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterval(TransactionRuleInterval interval) { this.interval = interval; + isSetInterval = true; // mark as set } /** @@ -550,6 +612,7 @@ public void setInterval(TransactionRuleInterval interval) { */ public TransactionRule outcomeType(OutcomeTypeEnum outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -607,6 +670,7 @@ public OutcomeTypeEnum getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(OutcomeTypeEnum outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -617,6 +681,7 @@ public void setOutcomeType(OutcomeTypeEnum outcomeType) { */ public TransactionRule reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -640,6 +705,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -654,6 +720,7 @@ public void setReference(String reference) { */ public TransactionRule requestType(RequestTypeEnum requestType) { this.requestType = requestType; + isSetRequestType = true; // mark as set return this; } @@ -685,6 +752,7 @@ public RequestTypeEnum getRequestType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestType(RequestTypeEnum requestType) { this.requestType = requestType; + isSetRequestType = true; // mark as set } /** @@ -695,6 +763,7 @@ public void setRequestType(RequestTypeEnum requestType) { */ public TransactionRule ruleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; + isSetRuleRestrictions = true; // mark as set return this; } @@ -718,6 +787,7 @@ public TransactionRuleRestrictions getRuleRestrictions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; + isSetRuleRestrictions = true; // mark as set } /** @@ -732,6 +802,7 @@ public void setRuleRestrictions(TransactionRuleRestrictions ruleRestrictions) { */ public TransactionRule score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -763,6 +834,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -778,6 +850,7 @@ public void setScore(Integer score) { */ public TransactionRule startDate(String startDate) { this.startDate = startDate; + isSetStartDate = true; // mark as set return this; } @@ -811,6 +884,7 @@ public String getStartDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartDate(String startDate) { this.startDate = startDate; + isSetStartDate = true; // mark as set } /** @@ -825,6 +899,7 @@ public void setStartDate(String startDate) { */ public TransactionRule status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -856,6 +931,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -878,6 +954,7 @@ public void setStatus(StatusEnum status) { */ public TransactionRule type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -925,6 +1002,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRule includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRule object is equal to o. */ @@ -1004,6 +1102,69 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAggregationLevel) { + addIfNull(nulls, JSON_PROPERTY_AGGREGATION_LEVEL, this.aggregationLevel); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetEndDate) { + addIfNull(nulls, JSON_PROPERTY_END_DATE, this.endDate); + } + if (isSetEntityKey) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_KEY, this.entityKey); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInterval) { + addIfNull(nulls, JSON_PROPERTY_INTERVAL, this.interval); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRequestType) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_TYPE, this.requestType); + } + if (isSetRuleRestrictions) { + addIfNull(nulls, JSON_PROPERTY_RULE_RESTRICTIONS, this.ruleRestrictions); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetStartDate) { + addIfNull(nulls, JSON_PROPERTY_START_DATE, this.startDate); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRule given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java index 1a0616f80..a9e17aaa4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class TransactionRuleEntityKey { public static final String JSON_PROPERTY_ENTITY_REFERENCE = "entityReference"; private String entityReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityReference = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private String entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleEntityKey() {} /** @@ -39,6 +53,7 @@ public TransactionRuleEntityKey() {} */ public TransactionRuleEntityKey entityReference(String entityReference) { this.entityReference = entityReference; + isSetEntityReference = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getEntityReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityReference(String entityReference) { this.entityReference = entityReference; + isSetEntityReference = true; // mark as set } /** @@ -75,6 +91,7 @@ public void setEntityReference(String entityReference) { */ public TransactionRuleEntityKey entityType(String entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -104,6 +121,27 @@ public String getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(String entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleEntityKey includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleEntityKey object is equal to o. */ @@ -145,6 +183,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntityReference) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_REFERENCE, this.entityReference); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleEntityKey given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java index f80632c35..98b8e6a31 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -41,18 +43,33 @@ public class TransactionRuleInfo { public static final String JSON_PROPERTY_AGGREGATION_LEVEL = "aggregationLevel"; private String aggregationLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAggregationLevel = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_END_DATE = "endDate"; private String endDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndDate = false; + public static final String JSON_PROPERTY_ENTITY_KEY = "entityKey"; private TransactionRuleEntityKey entityKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityKey = false; + public static final String JSON_PROPERTY_INTERVAL = "interval"; private TransactionRuleInterval interval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterval = false; + /** * The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied * when a transaction meets the conditions of the rule. Possible values: * **hardBlock** @@ -111,9 +128,15 @@ public static OutcomeTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private OutcomeTypeEnum outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * Indicates the type of request to which the rule applies. If not provided, by default, this is * set to **authorization**. Possible values: **authorization**, **authentication**, @@ -166,15 +189,27 @@ public static RequestTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUEST_TYPE = "requestType"; private RequestTypeEnum requestType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestType = false; + public static final String JSON_PROPERTY_RULE_RESTRICTIONS = "ruleRestrictions"; private TransactionRuleRestrictions ruleRestrictions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRuleRestrictions = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_START_DATE = "startDate"; private String startDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartDate = false; + /** * The status of the transaction rule. If you provide a `startDate` in the request, the * rule is automatically created with an **active** status. Possible values: **active**, @@ -223,6 +258,9 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + /** * The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines * if a rule blocks transactions based on individual characteristics or accumulates data. Possible @@ -279,6 +317,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleInfo() {} /** @@ -299,6 +346,7 @@ public TransactionRuleInfo() {} */ public TransactionRuleInfo aggregationLevel(String aggregationLevel) { this.aggregationLevel = aggregationLevel; + isSetAggregationLevel = true; // mark as set return this; } @@ -342,6 +390,7 @@ public String getAggregationLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAggregationLevel(String aggregationLevel) { this.aggregationLevel = aggregationLevel; + isSetAggregationLevel = true; // mark as set } /** @@ -352,6 +401,7 @@ public void setAggregationLevel(String aggregationLevel) { */ public TransactionRuleInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -375,6 +425,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -389,6 +440,7 @@ public void setDescription(String description) { */ public TransactionRuleInfo endDate(String endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set return this; } @@ -420,6 +472,7 @@ public String getEndDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndDate(String endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set } /** @@ -430,6 +483,7 @@ public void setEndDate(String endDate) { */ public TransactionRuleInfo entityKey(TransactionRuleEntityKey entityKey) { this.entityKey = entityKey; + isSetEntityKey = true; // mark as set return this; } @@ -453,6 +507,7 @@ public TransactionRuleEntityKey getEntityKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityKey(TransactionRuleEntityKey entityKey) { this.entityKey = entityKey; + isSetEntityKey = true; // mark as set } /** @@ -463,6 +518,7 @@ public void setEntityKey(TransactionRuleEntityKey entityKey) { */ public TransactionRuleInfo interval(TransactionRuleInterval interval) { this.interval = interval; + isSetInterval = true; // mark as set return this; } @@ -486,6 +542,7 @@ public TransactionRuleInterval getInterval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterval(TransactionRuleInterval interval) { this.interval = interval; + isSetInterval = true; // mark as set } /** @@ -513,6 +570,7 @@ public void setInterval(TransactionRuleInterval interval) { */ public TransactionRuleInfo outcomeType(OutcomeTypeEnum outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -570,6 +628,7 @@ public OutcomeTypeEnum getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(OutcomeTypeEnum outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -580,6 +639,7 @@ public void setOutcomeType(OutcomeTypeEnum outcomeType) { */ public TransactionRuleInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -603,6 +663,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -617,6 +678,7 @@ public void setReference(String reference) { */ public TransactionRuleInfo requestType(RequestTypeEnum requestType) { this.requestType = requestType; + isSetRequestType = true; // mark as set return this; } @@ -648,6 +710,7 @@ public RequestTypeEnum getRequestType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestType(RequestTypeEnum requestType) { this.requestType = requestType; + isSetRequestType = true; // mark as set } /** @@ -658,6 +721,7 @@ public void setRequestType(RequestTypeEnum requestType) { */ public TransactionRuleInfo ruleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; + isSetRuleRestrictions = true; // mark as set return this; } @@ -681,6 +745,7 @@ public TransactionRuleRestrictions getRuleRestrictions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; + isSetRuleRestrictions = true; // mark as set } /** @@ -695,6 +760,7 @@ public void setRuleRestrictions(TransactionRuleRestrictions ruleRestrictions) { */ public TransactionRuleInfo score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -726,6 +792,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -741,6 +808,7 @@ public void setScore(Integer score) { */ public TransactionRuleInfo startDate(String startDate) { this.startDate = startDate; + isSetStartDate = true; // mark as set return this; } @@ -774,6 +842,7 @@ public String getStartDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartDate(String startDate) { this.startDate = startDate; + isSetStartDate = true; // mark as set } /** @@ -788,6 +857,7 @@ public void setStartDate(String startDate) { */ public TransactionRuleInfo status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -819,6 +889,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -841,6 +912,7 @@ public void setStatus(StatusEnum status) { */ public TransactionRuleInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -888,6 +960,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleInfo object is equal to o. */ @@ -964,6 +1057,66 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAggregationLevel) { + addIfNull(nulls, JSON_PROPERTY_AGGREGATION_LEVEL, this.aggregationLevel); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetEndDate) { + addIfNull(nulls, JSON_PROPERTY_END_DATE, this.endDate); + } + if (isSetEntityKey) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_KEY, this.entityKey); + } + if (isSetInterval) { + addIfNull(nulls, JSON_PROPERTY_INTERVAL, this.interval); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRequestType) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_TYPE, this.requestType); + } + if (isSetRuleRestrictions) { + addIfNull(nulls, JSON_PROPERTY_RULE_RESTRICTIONS, this.ruleRestrictions); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetStartDate) { + addIfNull(nulls, JSON_PROPERTY_START_DATE, this.startDate); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java index e9ecdc45d..e5745783c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,6 +36,9 @@ public class TransactionRuleInterval { public static final String JSON_PROPERTY_DAY_OF_MONTH = "dayOfMonth"; private Integer dayOfMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDayOfMonth = false; + /** * The day of week, used when the `duration.unit` is **weeks**. If not provided, by * default, this is set to **monday**. Possible values: **sunday**, **monday**, **tuesday**, @@ -92,15 +97,27 @@ public static DayOfWeekEnum fromValue(String value) { public static final String JSON_PROPERTY_DAY_OF_WEEK = "dayOfWeek"; private DayOfWeekEnum dayOfWeek; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDayOfWeek = false; + public static final String JSON_PROPERTY_DURATION = "duration"; private Duration duration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDuration = false; + public static final String JSON_PROPERTY_TIME_OF_DAY = "timeOfDay"; private String timeOfDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeOfDay = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + /** * The [type of interval](https://docs.adyen.com/issuing/transaction-rules#time-intervals) during * which the rule conditions and limits apply, and how often counters are reset. Possible values: @@ -167,6 +184,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleInterval() {} /** @@ -179,6 +205,7 @@ public TransactionRuleInterval() {} */ public TransactionRuleInterval dayOfMonth(Integer dayOfMonth) { this.dayOfMonth = dayOfMonth; + isSetDayOfMonth = true; // mark as set return this; } @@ -206,6 +233,7 @@ public Integer getDayOfMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDayOfMonth(Integer dayOfMonth) { this.dayOfMonth = dayOfMonth; + isSetDayOfMonth = true; // mark as set } /** @@ -220,6 +248,7 @@ public void setDayOfMonth(Integer dayOfMonth) { */ public TransactionRuleInterval dayOfWeek(DayOfWeekEnum dayOfWeek) { this.dayOfWeek = dayOfWeek; + isSetDayOfWeek = true; // mark as set return this; } @@ -251,6 +280,7 @@ public DayOfWeekEnum getDayOfWeek() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDayOfWeek(DayOfWeekEnum dayOfWeek) { this.dayOfWeek = dayOfWeek; + isSetDayOfWeek = true; // mark as set } /** @@ -261,6 +291,7 @@ public void setDayOfWeek(DayOfWeekEnum dayOfWeek) { */ public TransactionRuleInterval duration(Duration duration) { this.duration = duration; + isSetDuration = true; // mark as set return this; } @@ -284,6 +315,7 @@ public Duration getDuration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDuration(Duration duration) { this.duration = duration; + isSetDuration = true; // mark as set } /** @@ -297,6 +329,7 @@ public void setDuration(Duration duration) { */ public TransactionRuleInterval timeOfDay(String timeOfDay) { this.timeOfDay = timeOfDay; + isSetTimeOfDay = true; // mark as set return this; } @@ -326,6 +359,7 @@ public String getTimeOfDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeOfDay(String timeOfDay) { this.timeOfDay = timeOfDay; + isSetTimeOfDay = true; // mark as set } /** @@ -338,6 +372,7 @@ public void setTimeOfDay(String timeOfDay) { */ public TransactionRuleInterval timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -365,6 +400,7 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set } /** @@ -397,6 +433,7 @@ public void setTimeZone(String timeZone) { */ public TransactionRuleInterval type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -464,6 +501,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleInterval includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleInterval object is equal to o. */ @@ -513,6 +571,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDayOfMonth) { + addIfNull(nulls, JSON_PROPERTY_DAY_OF_MONTH, this.dayOfMonth); + } + if (isSetDayOfWeek) { + addIfNull(nulls, JSON_PROPERTY_DAY_OF_WEEK, this.dayOfWeek); + } + if (isSetDuration) { + addIfNull(nulls, JSON_PROPERTY_DURATION, this.duration); + } + if (isSetTimeOfDay) { + addIfNull(nulls, JSON_PROPERTY_TIME_OF_DAY, this.timeOfDay); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleInterval given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java index 71abff1aa..2d06ba6da 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class TransactionRuleResponse { public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; private TransactionRule transactionRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRule = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleResponse() {} /** @@ -33,6 +44,7 @@ public TransactionRuleResponse() {} */ public TransactionRuleResponse transactionRule(TransactionRule transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set return this; } @@ -56,6 +68,27 @@ public TransactionRule getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(TransactionRule transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleResponse object is equal to o. */ @@ -95,6 +128,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransactionRule) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java index 82b143bc8..5eef44649 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -49,81 +51,162 @@ public class TransactionRuleRestrictions { public static final String JSON_PROPERTY_ACTIVE_NETWORK_TOKENS = "activeNetworkTokens"; private ActiveNetworkTokensRestriction activeNetworkTokens; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActiveNetworkTokens = false; + public static final String JSON_PROPERTY_BRAND_VARIANTS = "brandVariants"; private BrandVariantsRestriction brandVariants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariants = false; + public static final String JSON_PROPERTY_COUNTERPARTY_BANK = "counterpartyBank"; private CounterpartyBankRestriction counterpartyBank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterpartyBank = false; + public static final String JSON_PROPERTY_COUNTERPARTY_TYPES = "counterpartyTypes"; private CounterpartyTypesRestriction counterpartyTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterpartyTypes = false; + public static final String JSON_PROPERTY_COUNTRIES = "countries"; private CountriesRestriction countries; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountries = false; + public static final String JSON_PROPERTY_DAY_OF_WEEK = "dayOfWeek"; private DayOfWeekRestriction dayOfWeek; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDayOfWeek = false; + public static final String JSON_PROPERTY_DIFFERENT_CURRENCIES = "differentCurrencies"; private DifferentCurrenciesRestriction differentCurrencies; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDifferentCurrencies = false; + public static final String JSON_PROPERTY_ENTRY_MODES = "entryModes"; private EntryModesRestriction entryModes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntryModes = false; + public static final String JSON_PROPERTY_INTERNATIONAL_TRANSACTION = "internationalTransaction"; private InternationalTransactionRestriction internationalTransaction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInternationalTransaction = false; + public static final String JSON_PROPERTY_MATCHING_TRANSACTIONS = "matchingTransactions"; private MatchingTransactionsRestriction matchingTransactions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMatchingTransactions = false; + public static final String JSON_PROPERTY_MATCHING_VALUES = "matchingValues"; private MatchingValuesRestriction matchingValues; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMatchingValues = false; + public static final String JSON_PROPERTY_MCCS = "mccs"; private MccsRestriction mccs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMccs = false; + public static final String JSON_PROPERTY_MERCHANT_NAMES = "merchantNames"; private MerchantNamesRestriction merchantNames; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantNames = false; + public static final String JSON_PROPERTY_MERCHANTS = "merchants"; private MerchantsRestriction merchants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchants = false; + public static final String JSON_PROPERTY_PROCESSING_TYPES = "processingTypes"; private ProcessingTypesRestriction processingTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProcessingTypes = false; + public static final String JSON_PROPERTY_RISK_SCORES = "riskScores"; private RiskScoresRestriction riskScores; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScores = false; + public static final String JSON_PROPERTY_SAME_AMOUNT_RESTRICTION = "sameAmountRestriction"; private SameAmountRestriction sameAmountRestriction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSameAmountRestriction = false; + public static final String JSON_PROPERTY_SAME_COUNTERPARTY_RESTRICTION = "sameCounterpartyRestriction"; private SameCounterpartyRestriction sameCounterpartyRestriction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSameCounterpartyRestriction = false; + public static final String JSON_PROPERTY_SOURCE_ACCOUNT_TYPES = "sourceAccountTypes"; private SourceAccountTypesRestriction sourceAccountTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSourceAccountTypes = false; + public static final String JSON_PROPERTY_TIME_OF_DAY = "timeOfDay"; private TimeOfDayRestriction timeOfDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeOfDay = false; + public static final String JSON_PROPERTY_TOKEN_REQUESTORS = "tokenRequestors"; private TokenRequestorsRestriction tokenRequestors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestors = false; + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "totalAmount"; private TotalAmountRestriction totalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalAmount = false; + public static final String JSON_PROPERTY_WALLET_PROVIDER_ACCOUNT_SCORE = "walletProviderAccountScore"; private WalletProviderAccountScoreRestriction walletProviderAccountScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletProviderAccountScore = false; + public static final String JSON_PROPERTY_WALLET_PROVIDER_DEVICE_SCORE = "walletProviderDeviceScore"; private WalletProviderDeviceScore walletProviderDeviceScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletProviderDeviceScore = false; + public static final String JSON_PROPERTY_WALLET_PROVIDER_DEVICE_TYPE = "walletProviderDeviceType"; private WalletProviderDeviceType walletProviderDeviceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletProviderDeviceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleRestrictions() {} /** @@ -135,6 +218,7 @@ public TransactionRuleRestrictions() {} public TransactionRuleRestrictions activeNetworkTokens( ActiveNetworkTokensRestriction activeNetworkTokens) { this.activeNetworkTokens = activeNetworkTokens; + isSetActiveNetworkTokens = true; // mark as set return this; } @@ -158,6 +242,7 @@ public ActiveNetworkTokensRestriction getActiveNetworkTokens() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setActiveNetworkTokens(ActiveNetworkTokensRestriction activeNetworkTokens) { this.activeNetworkTokens = activeNetworkTokens; + isSetActiveNetworkTokens = true; // mark as set } /** @@ -168,6 +253,7 @@ public void setActiveNetworkTokens(ActiveNetworkTokensRestriction activeNetworkT */ public TransactionRuleRestrictions brandVariants(BrandVariantsRestriction brandVariants) { this.brandVariants = brandVariants; + isSetBrandVariants = true; // mark as set return this; } @@ -191,6 +277,7 @@ public BrandVariantsRestriction getBrandVariants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariants(BrandVariantsRestriction brandVariants) { this.brandVariants = brandVariants; + isSetBrandVariants = true; // mark as set } /** @@ -202,6 +289,7 @@ public void setBrandVariants(BrandVariantsRestriction brandVariants) { public TransactionRuleRestrictions counterpartyBank( CounterpartyBankRestriction counterpartyBank) { this.counterpartyBank = counterpartyBank; + isSetCounterpartyBank = true; // mark as set return this; } @@ -225,6 +313,7 @@ public CounterpartyBankRestriction getCounterpartyBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterpartyBank(CounterpartyBankRestriction counterpartyBank) { this.counterpartyBank = counterpartyBank; + isSetCounterpartyBank = true; // mark as set } /** @@ -236,6 +325,7 @@ public void setCounterpartyBank(CounterpartyBankRestriction counterpartyBank) { public TransactionRuleRestrictions counterpartyTypes( CounterpartyTypesRestriction counterpartyTypes) { this.counterpartyTypes = counterpartyTypes; + isSetCounterpartyTypes = true; // mark as set return this; } @@ -259,6 +349,7 @@ public CounterpartyTypesRestriction getCounterpartyTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterpartyTypes(CounterpartyTypesRestriction counterpartyTypes) { this.counterpartyTypes = counterpartyTypes; + isSetCounterpartyTypes = true; // mark as set } /** @@ -269,6 +360,7 @@ public void setCounterpartyTypes(CounterpartyTypesRestriction counterpartyTypes) */ public TransactionRuleRestrictions countries(CountriesRestriction countries) { this.countries = countries; + isSetCountries = true; // mark as set return this; } @@ -292,6 +384,7 @@ public CountriesRestriction getCountries() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountries(CountriesRestriction countries) { this.countries = countries; + isSetCountries = true; // mark as set } /** @@ -302,6 +395,7 @@ public void setCountries(CountriesRestriction countries) { */ public TransactionRuleRestrictions dayOfWeek(DayOfWeekRestriction dayOfWeek) { this.dayOfWeek = dayOfWeek; + isSetDayOfWeek = true; // mark as set return this; } @@ -325,6 +419,7 @@ public DayOfWeekRestriction getDayOfWeek() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDayOfWeek(DayOfWeekRestriction dayOfWeek) { this.dayOfWeek = dayOfWeek; + isSetDayOfWeek = true; // mark as set } /** @@ -336,6 +431,7 @@ public void setDayOfWeek(DayOfWeekRestriction dayOfWeek) { public TransactionRuleRestrictions differentCurrencies( DifferentCurrenciesRestriction differentCurrencies) { this.differentCurrencies = differentCurrencies; + isSetDifferentCurrencies = true; // mark as set return this; } @@ -359,6 +455,7 @@ public DifferentCurrenciesRestriction getDifferentCurrencies() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDifferentCurrencies(DifferentCurrenciesRestriction differentCurrencies) { this.differentCurrencies = differentCurrencies; + isSetDifferentCurrencies = true; // mark as set } /** @@ -369,6 +466,7 @@ public void setDifferentCurrencies(DifferentCurrenciesRestriction differentCurre */ public TransactionRuleRestrictions entryModes(EntryModesRestriction entryModes) { this.entryModes = entryModes; + isSetEntryModes = true; // mark as set return this; } @@ -392,6 +490,7 @@ public EntryModesRestriction getEntryModes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntryModes(EntryModesRestriction entryModes) { this.entryModes = entryModes; + isSetEntryModes = true; // mark as set } /** @@ -403,6 +502,7 @@ public void setEntryModes(EntryModesRestriction entryModes) { public TransactionRuleRestrictions internationalTransaction( InternationalTransactionRestriction internationalTransaction) { this.internationalTransaction = internationalTransaction; + isSetInternationalTransaction = true; // mark as set return this; } @@ -427,6 +527,7 @@ public InternationalTransactionRestriction getInternationalTransaction() { public void setInternationalTransaction( InternationalTransactionRestriction internationalTransaction) { this.internationalTransaction = internationalTransaction; + isSetInternationalTransaction = true; // mark as set } /** @@ -438,6 +539,7 @@ public void setInternationalTransaction( public TransactionRuleRestrictions matchingTransactions( MatchingTransactionsRestriction matchingTransactions) { this.matchingTransactions = matchingTransactions; + isSetMatchingTransactions = true; // mark as set return this; } @@ -461,6 +563,7 @@ public MatchingTransactionsRestriction getMatchingTransactions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMatchingTransactions(MatchingTransactionsRestriction matchingTransactions) { this.matchingTransactions = matchingTransactions; + isSetMatchingTransactions = true; // mark as set } /** @@ -471,6 +574,7 @@ public void setMatchingTransactions(MatchingTransactionsRestriction matchingTran */ public TransactionRuleRestrictions matchingValues(MatchingValuesRestriction matchingValues) { this.matchingValues = matchingValues; + isSetMatchingValues = true; // mark as set return this; } @@ -494,6 +598,7 @@ public MatchingValuesRestriction getMatchingValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMatchingValues(MatchingValuesRestriction matchingValues) { this.matchingValues = matchingValues; + isSetMatchingValues = true; // mark as set } /** @@ -504,6 +609,7 @@ public void setMatchingValues(MatchingValuesRestriction matchingValues) { */ public TransactionRuleRestrictions mccs(MccsRestriction mccs) { this.mccs = mccs; + isSetMccs = true; // mark as set return this; } @@ -527,6 +633,7 @@ public MccsRestriction getMccs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMccs(MccsRestriction mccs) { this.mccs = mccs; + isSetMccs = true; // mark as set } /** @@ -537,6 +644,7 @@ public void setMccs(MccsRestriction mccs) { */ public TransactionRuleRestrictions merchantNames(MerchantNamesRestriction merchantNames) { this.merchantNames = merchantNames; + isSetMerchantNames = true; // mark as set return this; } @@ -560,6 +668,7 @@ public MerchantNamesRestriction getMerchantNames() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantNames(MerchantNamesRestriction merchantNames) { this.merchantNames = merchantNames; + isSetMerchantNames = true; // mark as set } /** @@ -570,6 +679,7 @@ public void setMerchantNames(MerchantNamesRestriction merchantNames) { */ public TransactionRuleRestrictions merchants(MerchantsRestriction merchants) { this.merchants = merchants; + isSetMerchants = true; // mark as set return this; } @@ -593,6 +703,7 @@ public MerchantsRestriction getMerchants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchants(MerchantsRestriction merchants) { this.merchants = merchants; + isSetMerchants = true; // mark as set } /** @@ -603,6 +714,7 @@ public void setMerchants(MerchantsRestriction merchants) { */ public TransactionRuleRestrictions processingTypes(ProcessingTypesRestriction processingTypes) { this.processingTypes = processingTypes; + isSetProcessingTypes = true; // mark as set return this; } @@ -626,6 +738,7 @@ public ProcessingTypesRestriction getProcessingTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingTypes(ProcessingTypesRestriction processingTypes) { this.processingTypes = processingTypes; + isSetProcessingTypes = true; // mark as set } /** @@ -636,6 +749,7 @@ public void setProcessingTypes(ProcessingTypesRestriction processingTypes) { */ public TransactionRuleRestrictions riskScores(RiskScoresRestriction riskScores) { this.riskScores = riskScores; + isSetRiskScores = true; // mark as set return this; } @@ -659,6 +773,7 @@ public RiskScoresRestriction getRiskScores() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScores(RiskScoresRestriction riskScores) { this.riskScores = riskScores; + isSetRiskScores = true; // mark as set } /** @@ -670,6 +785,7 @@ public void setRiskScores(RiskScoresRestriction riskScores) { public TransactionRuleRestrictions sameAmountRestriction( SameAmountRestriction sameAmountRestriction) { this.sameAmountRestriction = sameAmountRestriction; + isSetSameAmountRestriction = true; // mark as set return this; } @@ -693,6 +809,7 @@ public SameAmountRestriction getSameAmountRestriction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSameAmountRestriction(SameAmountRestriction sameAmountRestriction) { this.sameAmountRestriction = sameAmountRestriction; + isSetSameAmountRestriction = true; // mark as set } /** @@ -704,6 +821,7 @@ public void setSameAmountRestriction(SameAmountRestriction sameAmountRestriction public TransactionRuleRestrictions sameCounterpartyRestriction( SameCounterpartyRestriction sameCounterpartyRestriction) { this.sameCounterpartyRestriction = sameCounterpartyRestriction; + isSetSameCounterpartyRestriction = true; // mark as set return this; } @@ -728,6 +846,7 @@ public SameCounterpartyRestriction getSameCounterpartyRestriction() { public void setSameCounterpartyRestriction( SameCounterpartyRestriction sameCounterpartyRestriction) { this.sameCounterpartyRestriction = sameCounterpartyRestriction; + isSetSameCounterpartyRestriction = true; // mark as set } /** @@ -739,6 +858,7 @@ public void setSameCounterpartyRestriction( public TransactionRuleRestrictions sourceAccountTypes( SourceAccountTypesRestriction sourceAccountTypes) { this.sourceAccountTypes = sourceAccountTypes; + isSetSourceAccountTypes = true; // mark as set return this; } @@ -762,6 +882,7 @@ public SourceAccountTypesRestriction getSourceAccountTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSourceAccountTypes(SourceAccountTypesRestriction sourceAccountTypes) { this.sourceAccountTypes = sourceAccountTypes; + isSetSourceAccountTypes = true; // mark as set } /** @@ -772,6 +893,7 @@ public void setSourceAccountTypes(SourceAccountTypesRestriction sourceAccountTyp */ public TransactionRuleRestrictions timeOfDay(TimeOfDayRestriction timeOfDay) { this.timeOfDay = timeOfDay; + isSetTimeOfDay = true; // mark as set return this; } @@ -795,6 +917,7 @@ public TimeOfDayRestriction getTimeOfDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeOfDay(TimeOfDayRestriction timeOfDay) { this.timeOfDay = timeOfDay; + isSetTimeOfDay = true; // mark as set } /** @@ -805,6 +928,7 @@ public void setTimeOfDay(TimeOfDayRestriction timeOfDay) { */ public TransactionRuleRestrictions tokenRequestors(TokenRequestorsRestriction tokenRequestors) { this.tokenRequestors = tokenRequestors; + isSetTokenRequestors = true; // mark as set return this; } @@ -828,6 +952,7 @@ public TokenRequestorsRestriction getTokenRequestors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenRequestors(TokenRequestorsRestriction tokenRequestors) { this.tokenRequestors = tokenRequestors; + isSetTokenRequestors = true; // mark as set } /** @@ -838,6 +963,7 @@ public void setTokenRequestors(TokenRequestorsRestriction tokenRequestors) { */ public TransactionRuleRestrictions totalAmount(TotalAmountRestriction totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set return this; } @@ -861,6 +987,7 @@ public TotalAmountRestriction getTotalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalAmount(TotalAmountRestriction totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set } /** @@ -872,6 +999,7 @@ public void setTotalAmount(TotalAmountRestriction totalAmount) { public TransactionRuleRestrictions walletProviderAccountScore( WalletProviderAccountScoreRestriction walletProviderAccountScore) { this.walletProviderAccountScore = walletProviderAccountScore; + isSetWalletProviderAccountScore = true; // mark as set return this; } @@ -896,6 +1024,7 @@ public WalletProviderAccountScoreRestriction getWalletProviderAccountScore() { public void setWalletProviderAccountScore( WalletProviderAccountScoreRestriction walletProviderAccountScore) { this.walletProviderAccountScore = walletProviderAccountScore; + isSetWalletProviderAccountScore = true; // mark as set } /** @@ -907,6 +1036,7 @@ public void setWalletProviderAccountScore( public TransactionRuleRestrictions walletProviderDeviceScore( WalletProviderDeviceScore walletProviderDeviceScore) { this.walletProviderDeviceScore = walletProviderDeviceScore; + isSetWalletProviderDeviceScore = true; // mark as set return this; } @@ -930,6 +1060,7 @@ public WalletProviderDeviceScore getWalletProviderDeviceScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletProviderDeviceScore(WalletProviderDeviceScore walletProviderDeviceScore) { this.walletProviderDeviceScore = walletProviderDeviceScore; + isSetWalletProviderDeviceScore = true; // mark as set } /** @@ -941,6 +1072,7 @@ public void setWalletProviderDeviceScore(WalletProviderDeviceScore walletProvide public TransactionRuleRestrictions walletProviderDeviceType( WalletProviderDeviceType walletProviderDeviceType) { this.walletProviderDeviceType = walletProviderDeviceType; + isSetWalletProviderDeviceType = true; // mark as set return this; } @@ -964,6 +1096,27 @@ public WalletProviderDeviceType getWalletProviderDeviceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletProviderDeviceType(WalletProviderDeviceType walletProviderDeviceType) { this.walletProviderDeviceType = walletProviderDeviceType; + isSetWalletProviderDeviceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleRestrictions includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRuleRestrictions object is equal to o. */ @@ -1102,6 +1255,104 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetActiveNetworkTokens) { + addIfNull(nulls, JSON_PROPERTY_ACTIVE_NETWORK_TOKENS, this.activeNetworkTokens); + } + if (isSetBrandVariants) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANTS, this.brandVariants); + } + if (isSetCounterpartyBank) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY_BANK, this.counterpartyBank); + } + if (isSetCounterpartyTypes) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY_TYPES, this.counterpartyTypes); + } + if (isSetCountries) { + addIfNull(nulls, JSON_PROPERTY_COUNTRIES, this.countries); + } + if (isSetDayOfWeek) { + addIfNull(nulls, JSON_PROPERTY_DAY_OF_WEEK, this.dayOfWeek); + } + if (isSetDifferentCurrencies) { + addIfNull(nulls, JSON_PROPERTY_DIFFERENT_CURRENCIES, this.differentCurrencies); + } + if (isSetEntryModes) { + addIfNull(nulls, JSON_PROPERTY_ENTRY_MODES, this.entryModes); + } + if (isSetInternationalTransaction) { + addIfNull(nulls, JSON_PROPERTY_INTERNATIONAL_TRANSACTION, this.internationalTransaction); + } + if (isSetMatchingTransactions) { + addIfNull(nulls, JSON_PROPERTY_MATCHING_TRANSACTIONS, this.matchingTransactions); + } + if (isSetMatchingValues) { + addIfNull(nulls, JSON_PROPERTY_MATCHING_VALUES, this.matchingValues); + } + if (isSetMccs) { + addIfNull(nulls, JSON_PROPERTY_MCCS, this.mccs); + } + if (isSetMerchantNames) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAMES, this.merchantNames); + } + if (isSetMerchants) { + addIfNull(nulls, JSON_PROPERTY_MERCHANTS, this.merchants); + } + if (isSetProcessingTypes) { + addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPES, this.processingTypes); + } + if (isSetRiskScores) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORES, this.riskScores); + } + if (isSetSameAmountRestriction) { + addIfNull(nulls, JSON_PROPERTY_SAME_AMOUNT_RESTRICTION, this.sameAmountRestriction); + } + if (isSetSameCounterpartyRestriction) { + addIfNull( + nulls, JSON_PROPERTY_SAME_COUNTERPARTY_RESTRICTION, this.sameCounterpartyRestriction); + } + if (isSetSourceAccountTypes) { + addIfNull(nulls, JSON_PROPERTY_SOURCE_ACCOUNT_TYPES, this.sourceAccountTypes); + } + if (isSetTimeOfDay) { + addIfNull(nulls, JSON_PROPERTY_TIME_OF_DAY, this.timeOfDay); + } + if (isSetTokenRequestors) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUESTORS, this.tokenRequestors); + } + if (isSetTotalAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_AMOUNT, this.totalAmount); + } + if (isSetWalletProviderAccountScore) { + addIfNull( + nulls, JSON_PROPERTY_WALLET_PROVIDER_ACCOUNT_SCORE, this.walletProviderAccountScore); + } + if (isSetWalletProviderDeviceScore) { + addIfNull(nulls, JSON_PROPERTY_WALLET_PROVIDER_DEVICE_SCORE, this.walletProviderDeviceScore); + } + if (isSetWalletProviderDeviceType) { + addIfNull(nulls, JSON_PROPERTY_WALLET_PROVIDER_DEVICE_TYPE, this.walletProviderDeviceType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRuleRestrictions given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java index cae4762b0..dddc2c2c9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class TransactionRulesResponse { public static final String JSON_PROPERTY_TRANSACTION_RULES = "transactionRules"; private List transactionRules; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRules = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRulesResponse() {} /** @@ -35,6 +46,7 @@ public TransactionRulesResponse() {} */ public TransactionRulesResponse transactionRules(List transactionRules) { this.transactionRules = transactionRules; + isSetTransactionRules = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getTransactionRules() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRules(List transactionRules) { this.transactionRules = transactionRules; + isSetTransactionRules = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRulesResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransactionRulesResponse object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransactionRules) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULES, this.transactionRules); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionRulesResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferLimit.java b/src/main/java/com/adyen/model/balanceplatform/TransferLimit.java index 1b14a390b..fbbf043ba 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferLimit.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferLimit.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,30 +36,63 @@ public class TransferLimit { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; private OffsetDateTime endsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndsAt = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LIMIT_STATUS = "limitStatus"; private LimitStatus limitStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLimitStatus = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SCA_INFORMATION = "scaInformation"; private ScaInformation scaInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaInformation = false; + public static final String JSON_PROPERTY_SCOPE = "scope"; private Scope scope; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScope = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private OffsetDateTime startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + public static final String JSON_PROPERTY_TRANSFER_TYPE = "transferType"; private TransferType transferType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferLimit() {} /** @@ -68,6 +103,7 @@ public TransferLimit() {} */ public TransferLimit amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -91,6 +127,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -105,6 +142,7 @@ public void setAmount(Amount amount) { */ public TransferLimit endsAt(OffsetDateTime endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -136,6 +174,7 @@ public OffsetDateTime getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(OffsetDateTime endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -146,6 +185,7 @@ public void setEndsAt(OffsetDateTime endsAt) { */ public TransferLimit id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -169,6 +209,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -179,6 +220,7 @@ public void setId(String id) { */ public TransferLimit limitStatus(LimitStatus limitStatus) { this.limitStatus = limitStatus; + isSetLimitStatus = true; // mark as set return this; } @@ -202,6 +244,7 @@ public LimitStatus getLimitStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLimitStatus(LimitStatus limitStatus) { this.limitStatus = limitStatus; + isSetLimitStatus = true; // mark as set } /** @@ -212,6 +255,7 @@ public void setLimitStatus(LimitStatus limitStatus) { */ public TransferLimit reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -235,6 +279,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -245,6 +290,7 @@ public void setReference(String reference) { */ public TransferLimit scaInformation(ScaInformation scaInformation) { this.scaInformation = scaInformation; + isSetScaInformation = true; // mark as set return this; } @@ -268,6 +314,7 @@ public ScaInformation getScaInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaInformation(ScaInformation scaInformation) { this.scaInformation = scaInformation; + isSetScaInformation = true; // mark as set } /** @@ -278,6 +325,7 @@ public void setScaInformation(ScaInformation scaInformation) { */ public TransferLimit scope(Scope scope) { this.scope = scope; + isSetScope = true; // mark as set return this; } @@ -301,6 +349,7 @@ public Scope getScope() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScope(Scope scope) { this.scope = scope; + isSetScope = true; // mark as set } /** @@ -315,6 +364,7 @@ public void setScope(Scope scope) { */ public TransferLimit startsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -346,6 +396,7 @@ public OffsetDateTime getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set } /** @@ -356,6 +407,7 @@ public void setStartsAt(OffsetDateTime startsAt) { */ public TransferLimit transferType(TransferType transferType) { this.transferType = transferType; + isSetTransferType = true; // mark as set return this; } @@ -379,6 +431,27 @@ public TransferType getTransferType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferType(TransferType transferType) { this.transferType = transferType; + isSetTransferType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferLimit includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferLimit object is equal to o. */ @@ -435,6 +508,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLimitStatus) { + addIfNull(nulls, JSON_PROPERTY_LIMIT_STATUS, this.limitStatus); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScaInformation) { + addIfNull(nulls, JSON_PROPERTY_SCA_INFORMATION, this.scaInformation); + } + if (isSetScope) { + addIfNull(nulls, JSON_PROPERTY_SCOPE, this.scope); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + if (isSetTransferType) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_TYPE, this.transferType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferLimit given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferLimitListResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransferLimitListResponse.java index e6cbc46d4..0680c6d9a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferLimitListResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferLimitListResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class TransferLimitListResponse { public static final String JSON_PROPERTY_TRANSFER_LIMITS = "transferLimits"; private List transferLimits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferLimits = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferLimitListResponse() {} /** @@ -35,6 +46,7 @@ public TransferLimitListResponse() {} */ public TransferLimitListResponse transferLimits(List transferLimits) { this.transferLimits = transferLimits; + isSetTransferLimits = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getTransferLimits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferLimits(List transferLimits) { this.transferLimits = transferLimits; + isSetTransferLimits = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferLimitListResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferLimitListResponse object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransferLimits) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_LIMITS, this.transferLimits); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferLimitListResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferRoute.java b/src/main/java/com/adyen/model/balanceplatform/TransferRoute.java index 723c0542e..783e44d8a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferRoute.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferRoute.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -96,22 +98,31 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the - * fees that you have to pay. Possible values: * **regular**: for normal, low-value transactions. - * * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for - * high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this + * fees that you have to pay. Possible values: * **regular**: For normal, low-value transactions. + * * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for + * high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this * has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: - * for instant funds transfers within the United States and in [SEPA + * For instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ public enum PriorityEnum { @@ -165,9 +176,21 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + public static final String JSON_PROPERTY_REQUIREMENTS = "requirements"; private List requirements; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequirements = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferRoute() {} /** @@ -182,6 +205,7 @@ public TransferRoute() {} */ public TransferRoute category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -213,6 +237,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -225,6 +250,7 @@ public void setCategory(CategoryEnum category) { */ public TransferRoute country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -252,6 +278,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -263,6 +290,7 @@ public void setCountry(String country) { */ public TransferRoute currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -288,60 +316,62 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the - * fees that you have to pay. Possible values: * **regular**: for normal, low-value transactions. - * * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for - * high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this + * fees that you have to pay. Possible values: * **regular**: For normal, low-value transactions. + * * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for + * high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this * has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: - * for instant funds transfers within the United States and in [SEPA + * For instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer - * is sent and the fees that you have to pay. Possible values: * **regular**: for normal, - * low-value transactions. * **fast**: a faster way to transfer funds, but the fees are - * higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way + * is sent and the fees that you have to pay. Possible values: * **regular**: For normal, + * low-value transactions. * **fast**: A faster way to transfer funds, but the fees are + * higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way * to transfer funds, but this has the highest fees. Recommended for high-priority, high-value - * transactions. * **instant**: for instant funds transfers within the United States and in + * transactions. * **instant**: For instant funds transfers within the United States and in * [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * @return the current {@code TransferRoute} instance, allowing for method chaining */ public TransferRoute priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the - * fees that you have to pay. Possible values: * **regular**: for normal, low-value transactions. - * * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for - * high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this + * fees that you have to pay. Possible values: * **regular**: For normal, low-value transactions. + * * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for + * high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this * has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: - * for instant funds transfers within the United States and in [SEPA + * For instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @return priority The priority for the bank transfer. This sets the speed at which the transfer - * is sent and the fees that you have to pay. Possible values: * **regular**: for normal, - * low-value transactions. * **fast**: a faster way to transfer funds, but the fees are - * higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way + * is sent and the fees that you have to pay. Possible values: * **regular**: For normal, + * low-value transactions. * **fast**: A faster way to transfer funds, but the fees are + * higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way * to transfer funds, but this has the highest fees. Recommended for high-priority, high-value - * transactions. * **instant**: for instant funds transfers within the United States and in + * transactions. * **instant**: For instant funds transfers within the United States and in * [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @@ -352,32 +382,33 @@ public PriorityEnum getPriority() { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the - * fees that you have to pay. Possible values: * **regular**: for normal, low-value transactions. - * * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for - * high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this + * fees that you have to pay. Possible values: * **regular**: For normal, low-value transactions. + * * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for + * high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this * has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: - * for instant funds transfers within the United States and in [SEPA + * For instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer - * is sent and the fees that you have to pay. Possible values: * **regular**: for normal, - * low-value transactions. * **fast**: a faster way to transfer funds, but the fees are - * higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way + * is sent and the fees that you have to pay. Possible values: * **regular**: For normal, + * low-value transactions. * **fast**: A faster way to transfer funds, but the fees are + * higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way * to transfer funds, but this has the highest fees. Recommended for high-priority, high-value - * transactions. * **instant**: for instant funds transfers within the United States and in + * transactions. * **instant**: For instant funds transfers within the United States and in * [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -394,6 +425,7 @@ public void setPriority(PriorityEnum priority) { */ public TransferRoute requirements(List requirements) { this.requirements = requirements; + isSetRequirements = true; // mark as set return this; } @@ -437,6 +469,27 @@ public List getRequirements() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequirements(List requirements) { this.requirements = requirements; + isSetRequirements = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferRoute includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferRoute object is equal to o. */ @@ -484,6 +537,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetRequirements) { + addIfNull(nulls, JSON_PROPERTY_REQUIREMENTS, this.requirements); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferRoute given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferRouteRequest.java b/src/main/java/com/adyen/model/balanceplatform/TransferRouteRequest.java index 0809b00a2..3de00e506 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferRouteRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferRouteRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,9 +39,15 @@ public class TransferRouteRequest { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + /** * The type of transfer. Possible values: - **bank**: Transfer to a [transfer * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) @@ -86,15 +94,27 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private Counterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -147,6 +167,15 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferRouteRequest() {} /** @@ -161,6 +190,7 @@ public TransferRouteRequest() {} */ public TransferRouteRequest balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -192,6 +222,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -203,6 +234,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public TransferRouteRequest balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -228,6 +260,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -242,6 +275,7 @@ public void setBalancePlatform(String balancePlatform) { */ public TransferRouteRequest category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -273,6 +307,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -283,6 +318,7 @@ public void setCategory(CategoryEnum category) { */ public TransferRouteRequest counterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -306,6 +342,7 @@ public Counterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -320,6 +357,7 @@ public void setCounterparty(Counterparty counterparty) { */ public TransferRouteRequest country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -351,6 +389,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -362,6 +401,7 @@ public void setCountry(String country) { */ public TransferRouteRequest currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -387,36 +427,38 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** * The list of priorities for the bank transfer. Priorities set the speed at which the transfer is * sent and the fees that you have to pay. Multiple values can be provided. Possible values: * - * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, - * but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the + * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, + * but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The * fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, - * high-value transactions. * **instant**: for instant funds transfers within the United States + * high-value transactions. * **instant**: For instant funds transfers within the United States * and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priorities The list of priorities for the bank transfer. Priorities set the speed at * which the transfer is sent and the fees that you have to pay. Multiple values can be - * provided. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * provided. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * @return the current {@code TransferRouteRequest} instance, allowing for method chaining */ public TransferRouteRequest priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -431,26 +473,26 @@ public TransferRouteRequest addPrioritiesItem(PrioritiesEnum prioritiesItem) { /** * The list of priorities for the bank transfer. Priorities set the speed at which the transfer is * sent and the fees that you have to pay. Multiple values can be provided. Possible values: * - * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, - * but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the + * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, + * but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The * fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, - * high-value transactions. * **instant**: for instant funds transfers within the United States + * high-value transactions. * **instant**: For instant funds transfers within the United States * and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @return priorities The list of priorities for the bank transfer. Priorities set the speed at * which the transfer is sent and the fees that you have to pay. Multiple values can be - * provided. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * provided. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITIES) @@ -462,32 +504,53 @@ public List getPriorities() { /** * The list of priorities for the bank transfer. Priorities set the speed at which the transfer is * sent and the fees that you have to pay. Multiple values can be provided. Possible values: * - * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, - * but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the + * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, + * but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The * fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, - * high-value transactions. * **instant**: for instant funds transfers within the United States + * high-value transactions. * **instant**: For instant funds transfers within the United States * and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priorities The list of priorities for the bank transfer. Priorities set the speed at * which the transfer is sent and the fees that you have to pay. Multiple values can be - * provided. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * provided. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITIES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferRouteRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferRouteRequest object is equal to o. */ @@ -540,6 +603,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferRouteRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferRouteResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransferRouteResponse.java index 70da671ca..d4b57f44b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferRouteResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferRouteResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class TransferRouteResponse { public static final String JSON_PROPERTY_TRANSFER_ROUTES = "transferRoutes"; private List transferRoutes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferRoutes = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferRouteResponse() {} /** @@ -37,6 +48,7 @@ public TransferRouteResponse() {} */ public TransferRouteResponse transferRoutes(List transferRoutes) { this.transferRoutes = transferRoutes; + isSetTransferRoutes = true; // mark as set return this; } @@ -72,6 +84,27 @@ public List getTransferRoutes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferRoutes(List transferRoutes) { this.transferRoutes = transferRoutes; + isSetTransferRoutes = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferRouteResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TransferRouteResponse object is equal to o. */ @@ -111,6 +144,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransferRoutes) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_ROUTES, this.transferRoutes); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferRouteResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java index c2179eeb7..3feca116b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class UKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + /** **ukLocal** */ public enum TypeEnum { UKLOCAL(String.valueOf("ukLocal")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UKLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/USInstantPayoutAddressRequirement.java b/src/main/java/com/adyen/model/balanceplatform/USInstantPayoutAddressRequirement.java index 08b0c1d1a..e012153da 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USInstantPayoutAddressRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/USInstantPayoutAddressRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class USInstantPayoutAddressRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **usInstantPayoutAddressRequirement** */ public enum TypeEnum { USINSTANTPAYOUTADDRESSREQUIREMENT(String.valueOf("usInstantPayoutAddressRequirement")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public USInstantPayoutAddressRequirement() {} /** @@ -85,6 +99,7 @@ public USInstantPayoutAddressRequirement() {} */ public USInstantPayoutAddressRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -112,6 +127,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setDescription(String description) { */ public USInstantPayoutAddressRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public USInstantPayoutAddressRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this USInstantPayoutAddressRequirement object is equal to o. */ @@ -188,6 +226,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of USInstantPayoutAddressRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/USInternationalAchAddressRequirement.java b/src/main/java/com/adyen/model/balanceplatform/USInternationalAchAddressRequirement.java index 2c4fc47bd..a769abf7a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USInternationalAchAddressRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/USInternationalAchAddressRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class USInternationalAchAddressRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **usInternationalAchAddressRequirement** */ public enum TypeEnum { USINTERNATIONALACHADDRESSREQUIREMENT(String.valueOf("usInternationalAchAddressRequirement")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public USInternationalAchAddressRequirement() {} /** @@ -85,6 +99,7 @@ public USInternationalAchAddressRequirement() {} */ public USInternationalAchAddressRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -112,6 +127,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setDescription(String description) { */ public USInternationalAchAddressRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public USInternationalAchAddressRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this USInternationalAchAddressRequirement object is equal to o. */ @@ -188,6 +226,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of USInternationalAchAddressRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/USInternationalAchPriorityRequirement.java b/src/main/java/com/adyen/model/balanceplatform/USInternationalAchPriorityRequirement.java index e83b85ed3..de7919c7f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USInternationalAchPriorityRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/USInternationalAchPriorityRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class USInternationalAchPriorityRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **usInternationalAchPriorityRequirement** */ public enum TypeEnum { USINTERNATIONALACHPRIORITYREQUIREMENT(String.valueOf("usInternationalAchPriorityRequirement")); @@ -72,6 +77,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public USInternationalAchPriorityRequirement() {} /** @@ -85,6 +99,7 @@ public USInternationalAchPriorityRequirement() {} */ public USInternationalAchPriorityRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -112,6 +127,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setDescription(String description) { */ public USInternationalAchPriorityRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public USInternationalAchPriorityRequirement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this USInternationalAchPriorityRequirement object is equal to o. */ @@ -188,6 +226,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of USInternationalAchPriorityRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java index 9a27421eb..8361b3fd6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class USLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -78,9 +83,15 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + /** **usLocal** */ public enum TypeEnum { USLOCAL(String.valueOf("usLocal")); @@ -123,6 +134,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public USLocalAccountIdentification() {} /** @@ -133,6 +153,7 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -156,6 +177,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +189,7 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -192,6 +215,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -205,6 +229,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -234,6 +259,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -244,6 +270,7 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -267,6 +294,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public USLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this USLocalAccountIdentification object is equal to o. */ @@ -312,6 +360,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of USLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java b/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java index 646fdf789..c26221d79 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -73,6 +75,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpdateNetworkTokenRequest() {} /** @@ -85,6 +96,7 @@ public UpdateNetworkTokenRequest() {} */ public UpdateNetworkTokenRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -112,6 +124,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpdateNetworkTokenRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UpdateNetworkTokenRequest object is equal to o. */ @@ -151,6 +184,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UpdateNetworkTokenRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java index ef7c6c6d7..ce3a65db2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -48,36 +50,69 @@ public class UpdatePaymentInstrument { private List additionalBankAccountIdentifications; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankAccountIdentifications = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountDetails bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; private String paymentInstrumentGroupId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentGroupId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REPLACED_BY_ID = "replacedById"; private String replacedById; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacedById = false; + public static final String JSON_PROPERTY_REPLACEMENT_OF_ID = "replacementOfId"; private String replacementOfId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacementOfId = false; + /** * The status of the payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -135,9 +170,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for the status of the payment instrument. Possible values: **accountClosure**, * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, @@ -201,6 +242,9 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + /** The type of payment instrument. Possible values: **card**, **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -245,6 +289,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpdatePaymentInstrument() {} /** @@ -262,6 +315,7 @@ public UpdatePaymentInstrument additionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set return this; } @@ -308,6 +362,7 @@ public void setAdditionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set } /** @@ -322,6 +377,7 @@ public void setAdditionalBankAccountIdentifications( */ public UpdatePaymentInstrument balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -353,6 +409,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -363,6 +420,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public UpdatePaymentInstrument bankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -386,6 +444,7 @@ public BankAccountDetails getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -396,6 +455,7 @@ public void setBankAccount(BankAccountDetails bankAccount) { */ public UpdatePaymentInstrument card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -419,6 +479,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -429,6 +490,7 @@ public void setCard(Card card) { */ public UpdatePaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -452,6 +514,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -462,6 +525,7 @@ public void setDescription(String description) { */ public UpdatePaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -485,6 +549,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -498,6 +563,7 @@ public void setId(String id) { */ public UpdatePaymentInstrument issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -527,6 +593,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -541,6 +608,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public UpdatePaymentInstrument paymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set return this; } @@ -572,6 +640,7 @@ public String getPaymentInstrumentGroupId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set } /** @@ -582,6 +651,7 @@ public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { */ public UpdatePaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -605,6 +675,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -616,6 +687,7 @@ public void setReference(String reference) { */ public UpdatePaymentInstrument replacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set return this; } @@ -641,6 +713,7 @@ public String getReplacedById() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set } /** @@ -652,6 +725,7 @@ public void setReplacedById(String replacedById) { */ public UpdatePaymentInstrument replacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set return this; } @@ -677,6 +751,7 @@ public String getReplacementOfId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set } /** @@ -702,6 +777,7 @@ public void setReplacementOfId(String replacementOfId) { */ public UpdatePaymentInstrument status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -755,6 +831,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -767,6 +844,7 @@ public void setStatus(StatusEnum status) { */ public UpdatePaymentInstrument statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -794,6 +872,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -810,6 +889,7 @@ public void setStatusComment(String statusComment) { */ public UpdatePaymentInstrument statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -845,6 +925,7 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set } /** @@ -855,6 +936,7 @@ public void setStatusReason(StatusReasonEnum statusReason) { */ public UpdatePaymentInstrument type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -878,6 +960,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpdatePaymentInstrument includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UpdatePaymentInstrument object is equal to o. */ @@ -967,6 +1070,75 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalBankAccountIdentifications) { + addIfNull( + nulls, + JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS, + this.additionalBankAccountIdentifications); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetPaymentInstrumentGroupId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID, this.paymentInstrumentGroupId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReplacedById) { + addIfNull(nulls, JSON_PROPERTY_REPLACED_BY_ID, this.replacedById); + } + if (isSetReplacementOfId) { + addIfNull(nulls, JSON_PROPERTY_REPLACEMENT_OF_ID, this.replacementOfId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UpdatePaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java index ff6417562..d1a8dad68 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -96,18 +98,33 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private SweepCounterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -160,6 +177,9 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** The reason for disabling the sweep. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -209,6 +229,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -251,18 +273,33 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REASON_DETAIL = "reasonDetail"; private String reasonDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReasonDetail = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; private SweepSchedule schedule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + /** * The status of the sweep. If not provided, by default, this is set to **active**. Possible * values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on @@ -311,15 +348,27 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_SWEEP_AMOUNT = "sweepAmount"; private Amount sweepAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweepAmount = false; + public static final String JSON_PROPERTY_TARGET_AMOUNT = "targetAmount"; private Amount targetAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAmount = false; + public static final String JSON_PROPERTY_TRIGGER_AMOUNT = "triggerAmount"; private Amount triggerAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggerAmount = false; + /** * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not * provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to @@ -369,6 +418,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpdateSweepConfigurationV2() {} @JsonCreator @@ -400,6 +458,7 @@ public UpdateSweepConfigurationV2( */ public UpdateSweepConfigurationV2 category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -443,6 +502,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -453,6 +513,7 @@ public void setCategory(CategoryEnum category) { */ public UpdateSweepConfigurationV2 counterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -476,6 +537,7 @@ public SweepCounterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -492,6 +554,7 @@ public void setCounterparty(SweepCounterparty counterparty) { */ public UpdateSweepConfigurationV2 currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -527,6 +590,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -541,6 +605,7 @@ public void setCurrency(String currency) { */ public UpdateSweepConfigurationV2 description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -572,6 +637,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -594,14 +660,14 @@ public String getId() { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -617,14 +683,14 @@ public String getId() { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -634,6 +700,7 @@ public String getId() { */ public UpdateSweepConfigurationV2 priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -654,14 +721,14 @@ public UpdateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesIte * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -677,14 +744,14 @@ public UpdateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesIte * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -706,14 +773,14 @@ public List getPriorities() { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -729,14 +796,14 @@ public List getPriorities() { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -747,6 +814,7 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** @@ -779,6 +847,7 @@ public String getReasonDetail() { */ public UpdateSweepConfigurationV2 reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -802,6 +871,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -814,6 +884,7 @@ public void setReference(String reference) { */ public UpdateSweepConfigurationV2 referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -841,6 +912,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -851,6 +923,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public UpdateSweepConfigurationV2 schedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set return this; } @@ -874,6 +947,7 @@ public SweepSchedule getSchedule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set } /** @@ -889,6 +963,7 @@ public void setSchedule(SweepSchedule schedule) { */ public UpdateSweepConfigurationV2 status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -922,6 +997,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -932,6 +1008,7 @@ public void setStatus(StatusEnum status) { */ public UpdateSweepConfigurationV2 sweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set return this; } @@ -955,6 +1032,7 @@ public Amount getSweepAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set } /** @@ -965,6 +1043,7 @@ public void setSweepAmount(Amount sweepAmount) { */ public UpdateSweepConfigurationV2 targetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set return this; } @@ -988,6 +1067,7 @@ public Amount getTargetAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set } /** @@ -998,6 +1078,7 @@ public void setTargetAmount(Amount targetAmount) { */ public UpdateSweepConfigurationV2 triggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set return this; } @@ -1021,6 +1102,7 @@ public Amount getTriggerAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTriggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set } /** @@ -1037,6 +1119,7 @@ public void setTriggerAmount(Amount triggerAmount) { */ public UpdateSweepConfigurationV2 type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1072,6 +1155,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpdateSweepConfigurationV2 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UpdateSweepConfigurationV2 object is equal to o. */ @@ -1160,6 +1264,75 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReasonDetail) { + addIfNull(nulls, JSON_PROPERTY_REASON_DETAIL, this.reasonDetail); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSweepAmount) { + addIfNull(nulls, JSON_PROPERTY_SWEEP_AMOUNT, this.sweepAmount); + } + if (isSetTargetAmount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_AMOUNT, this.targetAmount); + } + if (isSetTriggerAmount) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER_AMOUNT, this.triggerAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UpdateSweepConfigurationV2 given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java index 1b1306286..9efc39e74 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -192,12 +194,27 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_ENTITY_IDS = "entityIds"; private List entityIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityIds = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationDeadline() {} @JsonCreator @@ -244,6 +261,26 @@ public OffsetDateTime getExpiresAt() { return expiresAt; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationDeadline includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + /** Return true if this VerificationDeadline object is equal to o. */ @Override public boolean equals(Object o) { @@ -285,6 +322,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetEntityIds) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_IDS, this.entityIds); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of VerificationDeadline given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationError.java b/src/main/java/com/adyen/model/balanceplatform/VerificationError.java index 364903afa..3a3e5f3c2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationError.java +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationError.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -195,18 +197,33 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + public static final String JSON_PROPERTY_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + public static final String JSON_PROPERTY_SUB_ERRORS = "subErrors"; private List subErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubErrors = false; + /** * The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * **dataReview** @@ -258,6 +275,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationError() {} /** @@ -268,6 +294,7 @@ public VerificationError() {} */ public VerificationError capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -299,6 +326,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -309,6 +337,7 @@ public void setCapabilities(List capabilities) { */ public VerificationError code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -332,6 +361,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -342,6 +372,7 @@ public void setCode(String code) { */ public VerificationError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -365,6 +396,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -376,6 +408,7 @@ public void setMessage(String message) { */ public VerificationError remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -409,6 +442,7 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set } /** @@ -419,6 +453,7 @@ public void setRemediatingActions(List remediatingActions) { */ public VerificationError subErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set return this; } @@ -450,6 +485,7 @@ public List getSubErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set } /** @@ -462,6 +498,7 @@ public void setSubErrors(List subErrors) { */ public VerificationError type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -489,6 +526,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationError includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this VerificationError object is equal to o. */ @@ -538,6 +596,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + if (isSetSubErrors) { + addIfNull(nulls, JSON_PROPERTY_SUB_ERRORS, this.subErrors); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of VerificationError given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java index c5f0f6f94..2cd41dc20 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -196,12 +198,21 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + /** * The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * **dataReview** @@ -253,9 +264,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationErrorRecursive() {} /** @@ -266,6 +289,7 @@ public VerificationErrorRecursive() {} */ public VerificationErrorRecursive capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -297,6 +321,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -307,6 +332,7 @@ public void setCapabilities(List capabilities) { */ public VerificationErrorRecursive code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -330,6 +356,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -340,6 +367,7 @@ public void setCode(String code) { */ public VerificationErrorRecursive message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -363,6 +391,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -375,6 +404,7 @@ public void setMessage(String message) { */ public VerificationErrorRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -402,6 +432,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -413,6 +444,7 @@ public void setType(TypeEnum type) { */ public VerificationErrorRecursive remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -447,6 +479,27 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationErrorRecursive includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this VerificationError-recursive object is equal to o. */ @@ -494,6 +547,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of VerificationErrorRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WalletProviderAccountScoreRestriction.java b/src/main/java/com/adyen/model/balanceplatform/WalletProviderAccountScoreRestriction.java index ceef30825..c37edf90e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WalletProviderAccountScoreRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/WalletProviderAccountScoreRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class WalletProviderAccountScoreRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Integer value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WalletProviderAccountScoreRestriction() {} /** @@ -40,6 +54,7 @@ public WalletProviderAccountScoreRestriction() {} */ public WalletProviderAccountScoreRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public WalletProviderAccountScoreRestriction value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -97,6 +114,27 @@ public Integer getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Integer value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WalletProviderAccountScoreRestriction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this WalletProviderAccountScoreRestriction object is equal to o. */ @@ -139,6 +177,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of WalletProviderAccountScoreRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceScore.java b/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceScore.java index 2d91ed64f..0dff00370 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceScore.java +++ b/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceScore.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class WalletProviderDeviceScore { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Integer value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WalletProviderDeviceScore() {} /** @@ -39,6 +53,7 @@ public WalletProviderDeviceScore() {} */ public WalletProviderDeviceScore operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public WalletProviderDeviceScore value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Integer getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Integer value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WalletProviderDeviceScore includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this WalletProviderDeviceScore object is equal to o. */ @@ -136,6 +174,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of WalletProviderDeviceScore given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceType.java b/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceType.java index 8a06909da..f47ad47a6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceType.java +++ b/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceType.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,6 +34,9 @@ public class WalletProviderDeviceType { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { CARD(String.valueOf("CARD")), @@ -88,6 +93,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WalletProviderDeviceType() {} /** @@ -98,6 +112,7 @@ public WalletProviderDeviceType() {} */ public WalletProviderDeviceType operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -121,6 +136,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -131,6 +147,7 @@ public void setOperation(String operation) { */ public WalletProviderDeviceType value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -162,6 +179,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WalletProviderDeviceType includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this WalletProviderDeviceType object is equal to o. */ @@ -203,6 +241,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of WalletProviderDeviceType given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WebhookSetting.java b/src/main/java/com/adyen/model/balanceplatform/WebhookSetting.java index 973e2fec5..ddf92027b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WebhookSetting.java +++ b/src/main/java/com/adyen/model/balanceplatform/WebhookSetting.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -46,18 +48,39 @@ public class WebhookSetting { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TARGET = "target"; private Target target; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTarget = false; + public static final String JSON_PROPERTY_TYPE = "type"; private SettingType type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WebhookSetting() {} /** @@ -70,6 +93,7 @@ public WebhookSetting() {} */ public WebhookSetting currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -97,6 +121,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -107,6 +132,7 @@ public void setCurrency(String currency) { */ public WebhookSetting id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -130,6 +156,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -140,6 +167,7 @@ public void setId(String id) { */ public WebhookSetting status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -163,6 +191,7 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -173,6 +202,7 @@ public void setStatus(String status) { */ public WebhookSetting target(Target target) { this.target = target; + isSetTarget = true; // mark as set return this; } @@ -196,6 +226,7 @@ public Target getTarget() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTarget(Target target) { this.target = target; + isSetTarget = true; // mark as set } /** @@ -206,6 +237,7 @@ public void setTarget(Target target) { */ public WebhookSetting type(SettingType type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -229,6 +261,27 @@ public SettingType getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(SettingType type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WebhookSetting includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this WebhookSetting object is equal to o. */ @@ -284,6 +337,42 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(WebhookSetting.class, "type", mappings); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTarget) { + addIfNull(nulls, JSON_PROPERTY_TARGET, this.target); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of WebhookSetting given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WebhookSettings.java b/src/main/java/com/adyen/model/balanceplatform/WebhookSettings.java index b28a145a0..bb863f7b6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WebhookSettings.java +++ b/src/main/java/com/adyen/model/balanceplatform/WebhookSettings.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class WebhookSettings { public static final String JSON_PROPERTY_WEBHOOK_SETTINGS = "webhookSettings"; private List webhookSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebhookSettings = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WebhookSettings() {} /** @@ -35,6 +46,7 @@ public WebhookSettings() {} */ public WebhookSettings webhookSettings(List webhookSettings) { this.webhookSettings = webhookSettings; + isSetWebhookSettings = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getWebhookSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebhookSettings(List webhookSettings) { this.webhookSettings = webhookSettings; + isSetWebhookSettings = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WebhookSettings includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this WebhookSettings object is equal to o. */ @@ -105,6 +138,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetWebhookSettings) { + addIfNull(nulls, JSON_PROPERTY_WEBHOOK_SETTINGS, this.webhookSettings); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of WebhookSettings given an JSON string * diff --git a/src/test/java/com/adyen/serializer/ModelTest.java b/src/test/java/com/adyen/serializer/ModelTest.java index abf956150..64c703baf 100644 --- a/src/test/java/com/adyen/serializer/ModelTest.java +++ b/src/test/java/com/adyen/serializer/ModelTest.java @@ -198,7 +198,7 @@ public void testFromJsonCheckoutPaymentMethodBcmcMobile() throws Exception { assertEquals("7219687191761347", storedPaymentMethodDetails.getStoredPaymentMethodId()); } - // test null values are not serialized + // test null values are not serialized @Test public void testToJsonTerminalSettingsSurchargeNotSet() throws JsonProcessingException { TerminalSettings terminalSettings = new TerminalSettings(); @@ -208,18 +208,19 @@ public void testToJsonTerminalSettingsSurchargeNotSet() throws JsonProcessingExc assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); } - // test values set as null are not serialized when includeNullValues is false - @Test - public void testToJsonTerminalSettingsSurchargeSetToNullWithoutEnablingIncludeNullValues() throws JsonProcessingException { - TerminalSettings terminalSettings = new TerminalSettings(); - terminalSettings - .connectivity(new Connectivity().simcardStatus(Connectivity.SimcardStatusEnum.ACTIVATED)) - .setSurcharge(null); - String json = terminalSettings.toJson(); - assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); - } - - // test values set as null (using setters) are serialized + // test values set as null are not serialized when includeNullValues is false + @Test + public void testToJsonTerminalSettingsSurchargeSetToNullWithoutEnablingIncludeNullValues() + throws JsonProcessingException { + TerminalSettings terminalSettings = new TerminalSettings(); + terminalSettings + .connectivity(new Connectivity().simcardStatus(Connectivity.SimcardStatusEnum.ACTIVATED)) + .setSurcharge(null); + String json = terminalSettings.toJson(); + assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); + } + + // test values set as null (using setters) are serialized @Test public void testToJsonTerminalSettingsSurchargeSetToNull() throws JsonProcessingException { TerminalSettings terminalSettings = new TerminalSettings(); @@ -231,7 +232,7 @@ public void testToJsonTerminalSettingsSurchargeSetToNull() throws JsonProcessing assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"},\"surcharge\":null}", json); } - // test values set as null (using build methods) are serialized + // test values set as null (using build methods) are serialized @Test public void testToJsonTerminalSettingsSurchargeChainToNull() throws JsonProcessingException { TerminalSettings terminalSettings = new TerminalSettings(); @@ -243,20 +244,22 @@ public void testToJsonTerminalSettingsSurchargeChainToNull() throws JsonProcessi assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"},\"surcharge\":null}", json); } - // test values, that are not explicitly SET as null, are not serialized (even when includeNullValues is true) - @Test - public void testToJsonFlagTrueButFieldNotSet() throws JsonProcessingException { - TerminalSettings terminalSettings = new TerminalSettings(); - // must consider null values that are explicitly set - terminalSettings.includeNullValues(true); + // test values, that are not explicitly SET as null, are not serialized (even when + // includeNullValues is true) + @Test + public void testToJsonFlagTrueButFieldNotSet() throws JsonProcessingException { + TerminalSettings terminalSettings = new TerminalSettings(); + // must consider null values that are explicitly set + terminalSettings.includeNullValues(true); - // We set connectivity, but we NEVER touch 'surcharge' - terminalSettings.setConnectivity(new Connectivity().simcardStatus(Connectivity.SimcardStatusEnum.ACTIVATED)); + // We set connectivity, but we NEVER touch 'surcharge' + terminalSettings.setConnectivity( + new Connectivity().simcardStatus(Connectivity.SimcardStatusEnum.ACTIVATED)); - String json = terminalSettings.toJson(); + String json = terminalSettings.toJson(); - // Expectation: 'surcharge' should NOT be present, even though the flag is true. - // It should only be present if we called setSurcharge(). - assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); - } + // Expectation: 'surcharge' should NOT be present, even though the flag is true. + // It should only be present if we called setSurcharge(). + assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); + } }