diff --git a/src/main/java/com/adyen/model/balanceplatform/Balance.java b/src/main/java/com/adyen/model/balanceplatform/Balance.java index f42dbb425..67f5f4e54 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Balance.java +++ b/src/main/java/com/adyen/model/balanceplatform/Balance.java @@ -25,7 +25,6 @@ Balance.JSON_PROPERTY_BALANCE, Balance.JSON_PROPERTY_CURRENCY, Balance.JSON_PROPERTY_PENDING, - Balance.JSON_PROPERTY_PENDING_AVAILABLE, Balance.JSON_PROPERTY_RESERVED }) public class Balance { @@ -53,12 +52,6 @@ public class Balance { /** 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; @@ -219,35 +212,6 @@ public void setPending(Long 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 - } - /** * The balance currently held in reserve. * @@ -321,8 +285,6 @@ public boolean equals(Object o) { && Objects.equals(this.isSetCurrency, balance.isSetCurrency) && Objects.equals(this.pending, balance.pending) && Objects.equals(this.isSetPending, balance.isSetPending) - && Objects.equals(this.pendingAvailable, balance.pendingAvailable) - && Objects.equals(this.isSetPendingAvailable, balance.isSetPendingAvailable) && Objects.equals(this.reserved, balance.reserved) && Objects.equals(this.isSetReserved, balance.isSetReserved); } @@ -338,8 +300,6 @@ public int hashCode() { isSetCurrency, pending, isSetPending, - pendingAvailable, - isSetPendingAvailable, reserved, isSetReserved); } @@ -352,7 +312,6 @@ 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(); @@ -390,9 +349,6 @@ public Map getExplicitNulls() { 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); } diff --git a/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java index c654f195a..a3b739f1e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java @@ -179,13 +179,8 @@ public enum ReasonEnum { AMOUNTLIMITEXCEEDED(String.valueOf("amountLimitExceeded")), - APPROVALEXPIRED(String.valueOf("approvalExpired")), - APPROVED(String.valueOf("approved")), - BALANCEACCOUNTTEMPORARILYBLOCKEDBYTRANSACTIONRULE( - String.valueOf("balanceAccountTemporarilyBlockedByTransactionRule")), - COUNTERPARTYACCOUNTBLOCKED(String.valueOf("counterpartyAccountBlocked")), COUNTERPARTYACCOUNTCLOSED(String.valueOf("counterpartyAccountClosed")), @@ -198,32 +193,16 @@ public enum ReasonEnum { COUNTERPARTYBANKUNAVAILABLE(String.valueOf("counterpartyBankUnavailable")), - DECLINED(String.valueOf("declined")), - - DECLINEDBYTRANSACTIONRULE(String.valueOf("declinedByTransactionRule")), - DIRECTDEBITNOTSUPPORTED(String.valueOf("directDebitNotSupported")), ERROR(String.valueOf("error")), NOTENOUGHBALANCE(String.valueOf("notEnoughBalance")), - PENDING(String.valueOf("pending")), - - PENDINGAPPROVAL(String.valueOf("pendingApproval")), - - PENDINGEXECUTION(String.valueOf("pendingExecution")), - REFUSEDBYCOUNTERPARTYBANK(String.valueOf("refusedByCounterpartyBank")), - REFUSEDBYCUSTOMER(String.valueOf("refusedByCustomer")), - ROUTENOTFOUND(String.valueOf("routeNotFound")), - SCAFAILED(String.valueOf("scaFailed")), - - SCHEMEADVICE(String.valueOf("schemeAdvice")), - TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); diff --git a/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java b/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java index 8418e05f7..5c82521c9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java @@ -20,7 +20,11 @@ import java.util.*; /** DeviceInfo */ -@JsonPropertyOrder({DeviceInfo.JSON_PROPERTY_FORM_FACTOR, DeviceInfo.JSON_PROPERTY_OS_NAME}) +@JsonPropertyOrder({ + DeviceInfo.JSON_PROPERTY_FORM_FACTOR, + DeviceInfo.JSON_PROPERTY_OS_NAME, + DeviceInfo.JSON_PROPERTY_PHONE +}) public class DeviceInfo { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private String formFactor; @@ -34,6 +38,12 @@ public class DeviceInfo { /** Mark when the attribute has been explicitly set. */ private boolean isSetOsName = false; + public static final String JSON_PROPERTY_PHONE = "phone"; + private PhoneInfo 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. @@ -112,6 +122,41 @@ public void setOsName(String osName) { isSetOsName = true; // mark as set } + /** + * phone + * + * @param phone + * @return the current {@code DeviceInfo} instance, allowing for method chaining + */ + public DeviceInfo phone(PhoneInfo phone) { + this.phone = phone; + isSetPhone = true; // mark as set + return this; + } + + /** + * Get phone + * + * @return phone + */ + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PhoneInfo getPhone() { + return phone; + } + + /** + * phone + * + * @param phone + */ + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(PhoneInfo phone) { + this.phone = phone; + isSetPhone = true; // mark as set + } + /** * Configures whether null values are explicitly serialized in the JSON payload. Default is false. */ @@ -145,12 +190,14 @@ public boolean equals(Object o) { return Objects.equals(this.formFactor, deviceInfo.formFactor) && Objects.equals(this.isSetFormFactor, deviceInfo.isSetFormFactor) && Objects.equals(this.osName, deviceInfo.osName) - && Objects.equals(this.isSetOsName, deviceInfo.isSetOsName); + && Objects.equals(this.isSetOsName, deviceInfo.isSetOsName) + && Objects.equals(this.phone, deviceInfo.phone) + && Objects.equals(this.isSetPhone, deviceInfo.isSetPhone); } @Override public int hashCode() { - return Objects.hash(formFactor, isSetFormFactor, osName, isSetOsName); + return Objects.hash(formFactor, isSetFormFactor, osName, isSetOsName, phone, isSetPhone); } @Override @@ -159,6 +206,7 @@ public String toString() { sb.append("class DeviceInfo {\n"); sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); sb.append("}"); return sb.toString(); } @@ -189,6 +237,9 @@ public Map getExplicitNulls() { if (isSetOsName) { addIfNull(nulls, JSON_PROPERTY_OS_NAME, this.osName); } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } return nulls; } diff --git a/src/main/java/com/adyen/model/balanceplatform/PhoneInfo.java b/src/main/java/com/adyen/model/balanceplatform/PhoneInfo.java new file mode 100644 index 000000000..16bbe582a --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PhoneInfo.java @@ -0,0 +1,277 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.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.*; + +/** PhoneInfo */ +@JsonPropertyOrder({ + PhoneInfo.JSON_PROPERTY_HASHED_NUMBER, + PhoneInfo.JSON_PROPERTY_LAST_FOUR_DIGITS, + PhoneInfo.JSON_PROPERTY_NUMBER +}) +public class PhoneInfo { + public static final String JSON_PROPERTY_HASHED_NUMBER = "hashedNumber"; + private String hashedNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHashedNumber = false; + + public static final String JSON_PROPERTY_LAST_FOUR_DIGITS = "lastFourDigits"; + private String lastFourDigits; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastFourDigits = false; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PhoneInfo() {} + + /** + * The hashed value of the phone number used to provision the network token. + * + * @param hashedNumber The hashed value of the phone number used to provision the network token. + * @return the current {@code PhoneInfo} instance, allowing for method chaining + */ + public PhoneInfo hashedNumber(String hashedNumber) { + this.hashedNumber = hashedNumber; + isSetHashedNumber = true; // mark as set + return this; + } + + /** + * The hashed value of the phone number used to provision the network token. + * + * @return hashedNumber The hashed value of the phone number used to provision the network token. + */ + @JsonProperty(JSON_PROPERTY_HASHED_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHashedNumber() { + return hashedNumber; + } + + /** + * The hashed value of the phone number used to provision the network token. + * + * @param hashedNumber The hashed value of the phone number used to provision the network token. + */ + @JsonProperty(JSON_PROPERTY_HASHED_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHashedNumber(String hashedNumber) { + this.hashedNumber = hashedNumber; + isSetHashedNumber = true; // mark as set + } + + /** + * The last four digits of the phone number used to provision the network token. + * + * @param lastFourDigits The last four digits of the phone number used to provision the network + * token. + * @return the current {@code PhoneInfo} instance, allowing for method chaining + */ + public PhoneInfo lastFourDigits(String lastFourDigits) { + this.lastFourDigits = lastFourDigits; + isSetLastFourDigits = true; // mark as set + return this; + } + + /** + * The last four digits of the phone number used to provision the network token. + * + * @return lastFourDigits The last four digits of the phone number used to provision the network + * token. + */ + @JsonProperty(JSON_PROPERTY_LAST_FOUR_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastFourDigits() { + return lastFourDigits; + } + + /** + * The last four digits of the phone number used to provision the network token. + * + * @param lastFourDigits The last four digits of the phone number used to provision the network + * token. + */ + @JsonProperty(JSON_PROPERTY_LAST_FOUR_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastFourDigits(String lastFourDigits) { + this.lastFourDigits = lastFourDigits; + isSetLastFourDigits = true; // mark as set + } + + /** + * The full phone number of the device used to provision the network token. + * + * @param number The full phone number of the device used to provision the network token. + * @return the current {@code PhoneInfo} instance, allowing for method chaining + */ + public PhoneInfo number(String number) { + this.number = number; + isSetNumber = true; // mark as set + return this; + } + + /** + * The full phone number of the device used to provision the network token. + * + * @return number The full phone number of the device used to provision the network token. + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNumber() { + return number; + } + + /** + * The full phone number of the device used to provision the network token. + * + * @param number The full phone number of the device used to provision the network token. + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; + isSetNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PhoneInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PhoneInfo object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneInfo phoneInfo = (PhoneInfo) o; + return Objects.equals(this.hashedNumber, phoneInfo.hashedNumber) + && Objects.equals(this.isSetHashedNumber, phoneInfo.isSetHashedNumber) + && Objects.equals(this.lastFourDigits, phoneInfo.lastFourDigits) + && Objects.equals(this.isSetLastFourDigits, phoneInfo.isSetLastFourDigits) + && Objects.equals(this.number, phoneInfo.number) + && Objects.equals(this.isSetNumber, phoneInfo.isSetNumber); + } + + @Override + public int hashCode() { + return Objects.hash( + hashedNumber, isSetHashedNumber, lastFourDigits, isSetLastFourDigits, number, isSetNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneInfo {\n"); + sb.append(" hashedNumber: ").append(toIndentedString(hashedNumber)).append("\n"); + sb.append(" lastFourDigits: ").append(toIndentedString(lastFourDigits)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetHashedNumber) { + addIfNull(nulls, JSON_PROPERTY_HASHED_NUMBER, this.hashedNumber); + } + if (isSetLastFourDigits) { + addIfNull(nulls, JSON_PROPERTY_LAST_FOUR_DIGITS, this.lastFourDigits); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PhoneInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneInfo + * @throws JsonProcessingException if the JSON string is invalid with respect to PhoneInfo + */ + public static PhoneInfo fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PhoneInfo.class); + } + + /** + * Convert an instance of PhoneInfo to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java index a9529ec3a..ff9ba06a2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java @@ -186,13 +186,8 @@ public enum ReasonEnum { AMOUNTLIMITEXCEEDED(String.valueOf("amountLimitExceeded")), - APPROVALEXPIRED(String.valueOf("approvalExpired")), - APPROVED(String.valueOf("approved")), - BALANCEACCOUNTTEMPORARILYBLOCKEDBYTRANSACTIONRULE( - String.valueOf("balanceAccountTemporarilyBlockedByTransactionRule")), - COUNTERPARTYACCOUNTBLOCKED(String.valueOf("counterpartyAccountBlocked")), COUNTERPARTYACCOUNTCLOSED(String.valueOf("counterpartyAccountClosed")), @@ -205,32 +200,16 @@ public enum ReasonEnum { COUNTERPARTYBANKUNAVAILABLE(String.valueOf("counterpartyBankUnavailable")), - DECLINED(String.valueOf("declined")), - - DECLINEDBYTRANSACTIONRULE(String.valueOf("declinedByTransactionRule")), - DIRECTDEBITNOTSUPPORTED(String.valueOf("directDebitNotSupported")), ERROR(String.valueOf("error")), NOTENOUGHBALANCE(String.valueOf("notEnoughBalance")), - PENDING(String.valueOf("pending")), - - PENDINGAPPROVAL(String.valueOf("pendingApproval")), - - PENDINGEXECUTION(String.valueOf("pendingExecution")), - REFUSEDBYCOUNTERPARTYBANK(String.valueOf("refusedByCounterpartyBank")), - REFUSEDBYCUSTOMER(String.valueOf("refusedByCustomer")), - ROUTENOTFOUND(String.valueOf("routeNotFound")), - SCAFAILED(String.valueOf("scaFailed")), - - SCHEMEADVICE(String.valueOf("schemeAdvice")), - TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java index 9b472d68c..f2c196d16 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java @@ -186,13 +186,8 @@ public enum ReasonEnum { AMOUNTLIMITEXCEEDED(String.valueOf("amountLimitExceeded")), - APPROVALEXPIRED(String.valueOf("approvalExpired")), - APPROVED(String.valueOf("approved")), - BALANCEACCOUNTTEMPORARILYBLOCKEDBYTRANSACTIONRULE( - String.valueOf("balanceAccountTemporarilyBlockedByTransactionRule")), - COUNTERPARTYACCOUNTBLOCKED(String.valueOf("counterpartyAccountBlocked")), COUNTERPARTYACCOUNTCLOSED(String.valueOf("counterpartyAccountClosed")), @@ -205,32 +200,16 @@ public enum ReasonEnum { COUNTERPARTYBANKUNAVAILABLE(String.valueOf("counterpartyBankUnavailable")), - DECLINED(String.valueOf("declined")), - - DECLINEDBYTRANSACTIONRULE(String.valueOf("declinedByTransactionRule")), - DIRECTDEBITNOTSUPPORTED(String.valueOf("directDebitNotSupported")), ERROR(String.valueOf("error")), NOTENOUGHBALANCE(String.valueOf("notEnoughBalance")), - PENDING(String.valueOf("pending")), - - PENDINGAPPROVAL(String.valueOf("pendingApproval")), - - PENDINGEXECUTION(String.valueOf("pendingExecution")), - REFUSEDBYCOUNTERPARTYBANK(String.valueOf("refusedByCounterpartyBank")), - REFUSEDBYCUSTOMER(String.valueOf("refusedByCustomer")), - ROUTENOTFOUND(String.valueOf("routeNotFound")), - SCAFAILED(String.valueOf("scaFailed")), - - SCHEMEADVICE(String.valueOf("schemeAdvice")), - TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown"));