diff --git a/sdk-generation-log/transfers.json b/sdk-generation-log/transfers.json index 244d92230..46cf4cfb1 100644 --- a/sdk-generation-log/transfers.json +++ b/sdk-generation-log/transfers.json @@ -1,8 +1,8 @@ { "service": "transfers", "project": "java", - "generatedAt": "2026-05-14T14:22:14Z", - "openapiCommitSha": "cbc5406a2df1f24d50e40742f18342f7ca7f21fc", + "generatedAt": "2026-06-15T16:42:52Z", + "openapiCommitSha": "fe790646de44602c0531c3ebd57c966876c7a1c7", "automationCommitSha": "6f06b47d0661f0891defe6b85461d2c367fbd284", - "libraryCommitSha": "5790580db2f8a931a68baba2bff9760b8aed2067" + "libraryCommitSha": "b2998c6eecc506e2d7ef07cc9b1eed1ee389a21b" } diff --git a/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java b/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java index fedff8f80..1a51eb0a2 100644 --- a/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java @@ -639,6 +639,42 @@ public BankAccountV3AccountIdentification(USLocalAccountIdentification o) { schemas.put("USLocalAccountIdentification", new GenericType() {}); JSON.registerDescendants( BankAccountV3AccountIdentification.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("auLocal", AULocalAccountIdentification.class); + mappings.put("brLocal", BRLocalAccountIdentification.class); + mappings.put("caLocal", CALocalAccountIdentification.class); + mappings.put("czLocal", CZLocalAccountIdentification.class); + mappings.put("dkLocal", DKLocalAccountIdentification.class); + mappings.put("hkLocal", HKLocalAccountIdentification.class); + mappings.put("huLocal", HULocalAccountIdentification.class); + mappings.put("iban", IbanAccountIdentification.class); + mappings.put("noLocal", NOLocalAccountIdentification.class); + mappings.put("numberAndBic", NumberAndBicAccountIdentification.class); + mappings.put("nzLocal", NZLocalAccountIdentification.class); + mappings.put("plLocal", PLLocalAccountIdentification.class); + mappings.put("seLocal", SELocalAccountIdentification.class); + mappings.put("sgLocal", SGLocalAccountIdentification.class); + mappings.put("ukLocal", UKLocalAccountIdentification.class); + mappings.put("usLocal", USLocalAccountIdentification.class); + mappings.put("AULocalAccountIdentification", AULocalAccountIdentification.class); + mappings.put("BRLocalAccountIdentification", BRLocalAccountIdentification.class); + mappings.put("CALocalAccountIdentification", CALocalAccountIdentification.class); + mappings.put("CZLocalAccountIdentification", CZLocalAccountIdentification.class); + mappings.put("DKLocalAccountIdentification", DKLocalAccountIdentification.class); + mappings.put("HKLocalAccountIdentification", HKLocalAccountIdentification.class); + mappings.put("HULocalAccountIdentification", HULocalAccountIdentification.class); + mappings.put("IbanAccountIdentification", IbanAccountIdentification.class); + mappings.put("NOLocalAccountIdentification", NOLocalAccountIdentification.class); + mappings.put("NZLocalAccountIdentification", NZLocalAccountIdentification.class); + mappings.put("NumberAndBicAccountIdentification", NumberAndBicAccountIdentification.class); + mappings.put("PLLocalAccountIdentification", PLLocalAccountIdentification.class); + mappings.put("SELocalAccountIdentification", SELocalAccountIdentification.class); + mappings.put("SGLocalAccountIdentification", SGLocalAccountIdentification.class); + mappings.put("UKLocalAccountIdentification", UKLocalAccountIdentification.class); + mappings.put("USLocalAccountIdentification", USLocalAccountIdentification.class); + mappings.put("BankAccountV3_accountIdentification", BankAccountV3AccountIdentification.class); + JSON.registerDiscriminator(BankAccountV3AccountIdentification.class, "type", mappings); } @Override diff --git a/src/main/java/com/adyen/model/transfers/CashOut.java b/src/main/java/com/adyen/model/transfers/CashOut.java new file mode 100644 index 000000000..8753b33fa --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/CashOut.java @@ -0,0 +1,680 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.transfers; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.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; + +/** CashOut */ +@JsonPropertyOrder({ + CashOut.JSON_PROPERTY_AMOUNT, + CashOut.JSON_PROPERTY_COUNTERPARTY, + CashOut.JSON_PROPERTY_DESCRIPTION, + CashOut.JSON_PROPERTY_FEE, + CashOut.JSON_PROPERTY_ID, + CashOut.JSON_PROPERTY_INSTRUCTING_BALANCE_ACCOUNT_ID, + CashOut.JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, + CashOut.JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, + CashOut.JSON_PROPERTY_TRANSFERS +}) +public class CashOut { + 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_COUNTERPARTY = "counterparty"; + private CashOutInfoCounterparty counterparty; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + + public static final String JSON_PROPERTY_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_INSTRUCTING_BALANCE_ACCOUNT_ID = + "instructingBalanceAccountId"; + private String instructingBalanceAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstructingBalanceAccountId = 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_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + /* deprecated */ + @Deprecated private String transferInstrumentId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + public static final String JSON_PROPERTY_TRANSFERS = "transfers"; + private List transfers; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransfers = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CashOut() {} + + /** + * amount + * + * @param amount + * @return the current {@code CashOut} instance, allowing for method chaining + */ + public CashOut amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * counterparty + * + * @param counterparty + * @return the current {@code CashOut} instance, allowing for method chaining + */ + public CashOut counterparty(CashOutInfoCounterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + return this; + } + + /** + * Get counterparty + * + * @return counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CashOutInfoCounterparty getCounterparty() { + return counterparty; + } + + /** + * counterparty + * + * @param counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCounterparty(CashOutInfoCounterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. Your description of the cashout transfer. This description is used by most banks as the + * transfer description. We recommend sending a maximum of 140 characters, otherwise the + * description may be truncated. If you do not provide a description, Adyen generates a + * description automatically. This generated description is not returned in the response. + * Supported characters: **[a-z] [A-Z] [0-9] / - ? : ( ) . , ' + Space**. + * + * @param description Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. Your description of the cashout + * transfer. This description is used by most banks as the transfer description. We recommend + * sending a maximum of 140 characters, otherwise the description may be truncated. If you do + * not provide a description, Adyen generates a description automatically. This generated + * description is not returned in the response. Supported characters: **[a-z] [A-Z] [0-9] / - + * ? : ( ) . , ' + Space**. + * @return the current {@code CashOut} instance, allowing for method chaining + */ + public CashOut description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. Your description of the cashout transfer. This description is used by most banks as the + * transfer description. We recommend sending a maximum of 140 characters, otherwise the + * description may be truncated. If you do not provide a description, Adyen generates a + * description automatically. This generated description is not returned in the response. + * Supported characters: **[a-z] [A-Z] [0-9] / - ? : ( ) . , ' + Space**. + * + * @return description Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. Your description of the cashout + * transfer. This description is used by most banks as the transfer description. We recommend + * sending a maximum of 140 characters, otherwise the description may be truncated. If you do + * not provide a description, Adyen generates a description automatically. This generated + * description is not returned in the response. Supported characters: **[a-z] [A-Z] [0-9] / - + * ? : ( ) . , ' + Space**. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. Your description of the cashout transfer. This description is used by most banks as the + * transfer description. We recommend sending a maximum of 140 characters, otherwise the + * description may be truncated. If you do not provide a description, Adyen generates a + * description automatically. This generated description is not returned in the response. + * Supported characters: **[a-z] [A-Z] [0-9] / - ? : ( ) . , ' + Space**. + * + * @param description Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. Your description of the cashout + * transfer. This description is used by most banks as the transfer description. We recommend + * sending a maximum of 140 characters, otherwise the description may be truncated. If you do + * not provide a description, Adyen generates a description automatically. This generated + * description is not returned in the response. Supported characters: **[a-z] [A-Z] [0-9] / - + * ? : ( ) . , ' + Space**. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * fee + * + * @param fee + * @return the current {@code CashOut} instance, allowing for method chaining + */ + public CashOut fee(Fee fee) { + this.fee = fee; + isSetFee = true; // mark as set + return this; + } + + /** + * Get fee + * + * @return fee + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Fee getFee() { + return fee; + } + + /** + * fee + * + * @param fee + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFee(Fee fee) { + this.fee = fee; + isSetFee = true; // mark as set + } + + /** + * The unique identifier of the cashout reference. + * + * @param id The unique identifier of the cashout reference. + * @return the current {@code CashOut} instance, allowing for method chaining + */ + public CashOut id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the cashout reference. + * + * @return id The unique identifier of the cashout reference. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the cashout reference. + * + * @param id The unique identifier of the cashout reference. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * The unique identifier of the balance account that initiates the cashout request. + * + * @param instructingBalanceAccountId The unique identifier of the balance account that initiates + * the cashout request. + * @return the current {@code CashOut} instance, allowing for method chaining + */ + public CashOut instructingBalanceAccountId(String instructingBalanceAccountId) { + this.instructingBalanceAccountId = instructingBalanceAccountId; + isSetInstructingBalanceAccountId = true; // mark as set + return this; + } + + /** + * The unique identifier of the balance account that initiates the cashout request. + * + * @return instructingBalanceAccountId The unique identifier of the balance account that initiates + * the cashout request. + */ + @JsonProperty(JSON_PROPERTY_INSTRUCTING_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstructingBalanceAccountId() { + return instructingBalanceAccountId; + } + + /** + * The unique identifier of the balance account that initiates the cashout request. + * + * @param instructingBalanceAccountId The unique identifier of the balance account that initiates + * the cashout request. + */ + @JsonProperty(JSON_PROPERTY_INSTRUCTING_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructingBalanceAccountId(String instructingBalanceAccountId) { + this.instructingBalanceAccountId = instructingBalanceAccountId; + isSetInstructingBalanceAccountId = true; // mark as set + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. The reference that is sent to the recipient of a cashout transfer. This reference is + * also sent in all webhooks related to the cashout transfer, so you can use it to track the + * status of the transfer. If you do not provide a reference for the beneficiary, Adyen generates + * one automatically. This generated reference for the beneficiary is not returned in the + * response. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. The reference that is sent to the + * recipient of a cashout transfer. This reference is also sent in all webhooks related to the + * cashout transfer, so you can use it to track the status of the transfer. If you do not + * provide a reference for the beneficiary, Adyen generates one automatically. This generated + * reference for the beneficiary is not returned in the response. Supported characters: + * **a-z**, **A-Z**, **0-9**. + * @return the current {@code CashOut} instance, allowing for method chaining + */ + public CashOut referenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + return this; + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. The reference that is sent to the recipient of a cashout transfer. This reference is + * also sent in all webhooks related to the cashout transfer, so you can use it to track the + * status of the transfer. If you do not provide a reference for the beneficiary, Adyen generates + * one automatically. This generated reference for the beneficiary is not returned in the + * response. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return referenceForBeneficiary Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. The reference that is sent to the + * recipient of a cashout transfer. This reference is also sent in all webhooks related to the + * cashout transfer, so you can use it to track the status of the transfer. If you do not + * provide a reference for the beneficiary, Adyen generates one automatically. This generated + * reference for the beneficiary is not returned in the response. Supported characters: + * **a-z**, **A-Z**, **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReferenceForBeneficiary() { + return referenceForBeneficiary; + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. The reference that is sent to the recipient of a cashout transfer. This reference is + * also sent in all webhooks related to the cashout transfer, so you can use it to track the + * status of the transfer. If you do not provide a reference for the beneficiary, Adyen generates + * one automatically. This generated reference for the beneficiary is not returned in the + * response. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. The reference that is sent to the + * recipient of a cashout transfer. This reference is also sent in all webhooks related to the + * cashout transfer, so you can use it to track the status of the transfer. If you do not + * provide a reference for the beneficiary, Adyen generates one automatically. This generated + * reference for the beneficiary is not returned in the response. Supported characters: + * **a-z**, **A-Z**, **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReferenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + } + + /** + * **Use `counterparty.transferInstrumentId` instead.** The unique identifier of the + * counterparty transfer instrument. + * + * @param transferInstrumentId **Use `counterparty.transferInstrumentId` instead.** The + * unique identifier of the counterparty transfer instrument. + * @return the current {@code CashOut} instance, allowing for method chaining + * @deprecated + */ + @Deprecated + public CashOut transferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + return this; + } + + /** + * **Use `counterparty.transferInstrumentId` instead.** The unique identifier of the + * counterparty transfer instrument. + * + * @return transferInstrumentId **Use `counterparty.transferInstrumentId` instead.** The + * unique identifier of the counterparty transfer instrument. + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransferInstrumentId() { + return transferInstrumentId; + } + + /** + * **Use `counterparty.transferInstrumentId` instead.** The unique identifier of the + * counterparty transfer instrument. + * + * @param transferInstrumentId **Use `counterparty.transferInstrumentId` instead.** The + * unique identifier of the counterparty transfer instrument. + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * The list of transfers related to cashout. + * + * @param transfers The list of transfers related to cashout. + * @return the current {@code CashOut} instance, allowing for method chaining + */ + public CashOut transfers(List transfers) { + this.transfers = transfers; + isSetTransfers = true; // mark as set + return this; + } + + public CashOut addTransfersItem(CashOutTransfer transfersItem) { + if (this.transfers == null) { + this.transfers = new ArrayList<>(); + } + this.transfers.add(transfersItem); + return this; + } + + /** + * The list of transfers related to cashout. + * + * @return transfers The list of transfers related to cashout. + */ + @JsonProperty(JSON_PROPERTY_TRANSFERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTransfers() { + return transfers; + } + + /** + * The list of transfers related to cashout. + * + * @param transfers The list of transfers related to cashout. + */ + @JsonProperty(JSON_PROPERTY_TRANSFERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransfers(List transfers) { + this.transfers = transfers; + isSetTransfers = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CashOut includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CashOut object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CashOut cashOut = (CashOut) o; + return Objects.equals(this.amount, cashOut.amount) + && Objects.equals(this.isSetAmount, cashOut.isSetAmount) + && Objects.equals(this.counterparty, cashOut.counterparty) + && Objects.equals(this.isSetCounterparty, cashOut.isSetCounterparty) + && Objects.equals(this.description, cashOut.description) + && Objects.equals(this.isSetDescription, cashOut.isSetDescription) + && Objects.equals(this.fee, cashOut.fee) + && Objects.equals(this.isSetFee, cashOut.isSetFee) + && Objects.equals(this.id, cashOut.id) + && Objects.equals(this.isSetId, cashOut.isSetId) + && Objects.equals(this.instructingBalanceAccountId, cashOut.instructingBalanceAccountId) + && Objects.equals( + this.isSetInstructingBalanceAccountId, cashOut.isSetInstructingBalanceAccountId) + && Objects.equals(this.referenceForBeneficiary, cashOut.referenceForBeneficiary) + && Objects.equals(this.isSetReferenceForBeneficiary, cashOut.isSetReferenceForBeneficiary) + && Objects.equals(this.transferInstrumentId, cashOut.transferInstrumentId) + && Objects.equals(this.isSetTransferInstrumentId, cashOut.isSetTransferInstrumentId) + && Objects.equals(this.transfers, cashOut.transfers) + && Objects.equals(this.isSetTransfers, cashOut.isSetTransfers); + } + + @Override + public int hashCode() { + return Objects.hash( + amount, + isSetAmount, + counterparty, + isSetCounterparty, + description, + isSetDescription, + fee, + isSetFee, + id, + isSetId, + instructingBalanceAccountId, + isSetInstructingBalanceAccountId, + referenceForBeneficiary, + isSetReferenceForBeneficiary, + transferInstrumentId, + isSetTransferInstrumentId, + transfers, + isSetTransfers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CashOut {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" instructingBalanceAccountId: ") + .append(toIndentedString(instructingBalanceAccountId)) + .append("\n"); + sb.append(" referenceForBeneficiary: ") + .append(toIndentedString(referenceForBeneficiary)) + .append("\n"); + sb.append(" transferInstrumentId: ") + .append(toIndentedString(transferInstrumentId)) + .append("\n"); + sb.append(" transfers: ").append(toIndentedString(transfers)).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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInstructingBalanceAccountId) { + addIfNull( + nulls, JSON_PROPERTY_INSTRUCTING_BALANCE_ACCOUNT_ID, this.instructingBalanceAccountId); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + if (isSetTransfers) { + addIfNull(nulls, JSON_PROPERTY_TRANSFERS, this.transfers); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CashOut given an JSON string + * + * @param jsonString JSON string + * @return An instance of CashOut + * @throws JsonProcessingException if the JSON string is invalid with respect to CashOut + */ + public static CashOut fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CashOut.class); + } + + /** + * Convert an instance of CashOut to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/transfers/CashOutInfo.java b/src/main/java/com/adyen/model/transfers/CashOutInfo.java new file mode 100644 index 000000000..223558a7a --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/CashOutInfo.java @@ -0,0 +1,604 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.transfers; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CashOutInfo */ +@JsonPropertyOrder({ + CashOutInfo.JSON_PROPERTY_AMOUNT, + CashOutInfo.JSON_PROPERTY_COUNTERPARTY, + CashOutInfo.JSON_PROPERTY_DESCRIPTION, + CashOutInfo.JSON_PROPERTY_FEE, + CashOutInfo.JSON_PROPERTY_ID, + CashOutInfo.JSON_PROPERTY_INSTRUCTING_BALANCE_ACCOUNT_ID, + CashOutInfo.JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, + CashOutInfo.JSON_PROPERTY_TRANSFER_INSTRUMENT_ID +}) +public class CashOutInfo { + 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_COUNTERPARTY = "counterparty"; + private CashOutInfoCounterparty counterparty; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + + public static final String JSON_PROPERTY_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_INSTRUCTING_BALANCE_ACCOUNT_ID = + "instructingBalanceAccountId"; + private String instructingBalanceAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstructingBalanceAccountId = 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_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + /* deprecated */ + @Deprecated 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 CashOutInfo() {} + + @JsonCreator + public CashOutInfo(@JsonProperty(JSON_PROPERTY_ID) String id) { + this(); + this.id = id; + } + + /** + * amount + * + * @param amount + * @return the current {@code CashOutInfo} instance, allowing for method chaining + */ + public CashOutInfo amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * counterparty + * + * @param counterparty + * @return the current {@code CashOutInfo} instance, allowing for method chaining + */ + public CashOutInfo counterparty(CashOutInfoCounterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + return this; + } + + /** + * Get counterparty + * + * @return counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CashOutInfoCounterparty getCounterparty() { + return counterparty; + } + + /** + * counterparty + * + * @param counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCounterparty(CashOutInfoCounterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. Your description of the cashout transfer. This description is used by most banks as the + * transfer description. We recommend sending a maximum of 140 characters, otherwise the + * description may be truncated. If you do not provide a description, Adyen generates a + * description automatically. This generated description is not returned in the response. + * Supported characters: **[a-z] [A-Z] [0-9] / - ? : ( ) . , ' + Space**. + * + * @param description Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. Your description of the cashout + * transfer. This description is used by most banks as the transfer description. We recommend + * sending a maximum of 140 characters, otherwise the description may be truncated. If you do + * not provide a description, Adyen generates a description automatically. This generated + * description is not returned in the response. Supported characters: **[a-z] [A-Z] [0-9] / - + * ? : ( ) . , ' + Space**. + * @return the current {@code CashOutInfo} instance, allowing for method chaining + */ + public CashOutInfo description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. Your description of the cashout transfer. This description is used by most banks as the + * transfer description. We recommend sending a maximum of 140 characters, otherwise the + * description may be truncated. If you do not provide a description, Adyen generates a + * description automatically. This generated description is not returned in the response. + * Supported characters: **[a-z] [A-Z] [0-9] / - ? : ( ) . , ' + Space**. + * + * @return description Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. Your description of the cashout + * transfer. This description is used by most banks as the transfer description. We recommend + * sending a maximum of 140 characters, otherwise the description may be truncated. If you do + * not provide a description, Adyen generates a description automatically. This generated + * description is not returned in the response. Supported characters: **[a-z] [A-Z] [0-9] / - + * ? : ( ) . , ' + Space**. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. Your description of the cashout transfer. This description is used by most banks as the + * transfer description. We recommend sending a maximum of 140 characters, otherwise the + * description may be truncated. If you do not provide a description, Adyen generates a + * description automatically. This generated description is not returned in the response. + * Supported characters: **[a-z] [A-Z] [0-9] / - ? : ( ) . , ' + Space**. + * + * @param description Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. Your description of the cashout + * transfer. This description is used by most banks as the transfer description. We recommend + * sending a maximum of 140 characters, otherwise the description may be truncated. If you do + * not provide a description, Adyen generates a description automatically. This generated + * description is not returned in the response. Supported characters: **[a-z] [A-Z] [0-9] / - + * ? : ( ) . , ' + Space**. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * fee + * + * @param fee + * @return the current {@code CashOutInfo} instance, allowing for method chaining + */ + public CashOutInfo fee(Fee fee) { + this.fee = fee; + isSetFee = true; // mark as set + return this; + } + + /** + * Get fee + * + * @return fee + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Fee getFee() { + return fee; + } + + /** + * fee + * + * @param fee + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFee(Fee fee) { + this.fee = fee; + isSetFee = true; // mark as set + } + + /** + * The ID of the resource. + * + * @return id The ID of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the balance account that initiates the cashout request. + * + * @param instructingBalanceAccountId The unique identifier of the balance account that initiates + * the cashout request. + * @return the current {@code CashOutInfo} instance, allowing for method chaining + */ + public CashOutInfo instructingBalanceAccountId(String instructingBalanceAccountId) { + this.instructingBalanceAccountId = instructingBalanceAccountId; + isSetInstructingBalanceAccountId = true; // mark as set + return this; + } + + /** + * The unique identifier of the balance account that initiates the cashout request. + * + * @return instructingBalanceAccountId The unique identifier of the balance account that initiates + * the cashout request. + */ + @JsonProperty(JSON_PROPERTY_INSTRUCTING_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstructingBalanceAccountId() { + return instructingBalanceAccountId; + } + + /** + * The unique identifier of the balance account that initiates the cashout request. + * + * @param instructingBalanceAccountId The unique identifier of the balance account that initiates + * the cashout request. + */ + @JsonProperty(JSON_PROPERTY_INSTRUCTING_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructingBalanceAccountId(String instructingBalanceAccountId) { + this.instructingBalanceAccountId = instructingBalanceAccountId; + isSetInstructingBalanceAccountId = true; // mark as set + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. The reference that is sent to the recipient of a cashout transfer. This reference is + * also sent in all webhooks related to the cashout transfer, so you can use it to track the + * status of the transfer. If you do not provide a reference for the beneficiary, Adyen generates + * one automatically. This generated reference for the beneficiary is not returned in the + * response. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. The reference that is sent to the + * recipient of a cashout transfer. This reference is also sent in all webhooks related to the + * cashout transfer, so you can use it to track the status of the transfer. If you do not + * provide a reference for the beneficiary, Adyen generates one automatically. This generated + * reference for the beneficiary is not returned in the response. Supported characters: + * **a-z**, **A-Z**, **0-9**. + * @return the current {@code CashOutInfo} instance, allowing for method chaining + */ + public CashOutInfo referenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + return this; + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. The reference that is sent to the recipient of a cashout transfer. This reference is + * also sent in all webhooks related to the cashout transfer, so you can use it to track the + * status of the transfer. If you do not provide a reference for the beneficiary, Adyen generates + * one automatically. This generated reference for the beneficiary is not returned in the + * response. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return referenceForBeneficiary Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. The reference that is sent to the + * recipient of a cashout transfer. This reference is also sent in all webhooks related to the + * cashout transfer, so you can use it to track the status of the transfer. If you do not + * provide a reference for the beneficiary, Adyen generates one automatically. This generated + * reference for the beneficiary is not returned in the response. Supported characters: + * **a-z**, **A-Z**, **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReferenceForBeneficiary() { + return referenceForBeneficiary; + } + + /** + * Allowed and returned only when you provide the `counterparty.transferInstrumentId` + * field. The reference that is sent to the recipient of a cashout transfer. This reference is + * also sent in all webhooks related to the cashout transfer, so you can use it to track the + * status of the transfer. If you do not provide a reference for the beneficiary, Adyen generates + * one automatically. This generated reference for the beneficiary is not returned in the + * response. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary Allowed and returned only when you provide the + * `counterparty.transferInstrumentId` field. The reference that is sent to the + * recipient of a cashout transfer. This reference is also sent in all webhooks related to the + * cashout transfer, so you can use it to track the status of the transfer. If you do not + * provide a reference for the beneficiary, Adyen generates one automatically. This generated + * reference for the beneficiary is not returned in the response. Supported characters: + * **a-z**, **A-Z**, **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReferenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + } + + /** + * **Use `counterparty.transferInstrumentId` instead.** The unique identifier of the + * counterparty transfer instrument. + * + * @param transferInstrumentId **Use `counterparty.transferInstrumentId` instead.** The + * unique identifier of the counterparty transfer instrument. + * @return the current {@code CashOutInfo} instance, allowing for method chaining + * @deprecated + */ + @Deprecated + public CashOutInfo transferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + return this; + } + + /** + * **Use `counterparty.transferInstrumentId` instead.** The unique identifier of the + * counterparty transfer instrument. + * + * @return transferInstrumentId **Use `counterparty.transferInstrumentId` instead.** The + * unique identifier of the counterparty transfer instrument. + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransferInstrumentId() { + return transferInstrumentId; + } + + /** + * **Use `counterparty.transferInstrumentId` instead.** The unique identifier of the + * counterparty transfer instrument. + * + * @param transferInstrumentId **Use `counterparty.transferInstrumentId` instead.** The + * unique identifier of the counterparty transfer instrument. + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @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 CashOutInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CashOutInfo object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CashOutInfo cashOutInfo = (CashOutInfo) o; + return Objects.equals(this.amount, cashOutInfo.amount) + && Objects.equals(this.isSetAmount, cashOutInfo.isSetAmount) + && Objects.equals(this.counterparty, cashOutInfo.counterparty) + && Objects.equals(this.isSetCounterparty, cashOutInfo.isSetCounterparty) + && Objects.equals(this.description, cashOutInfo.description) + && Objects.equals(this.isSetDescription, cashOutInfo.isSetDescription) + && Objects.equals(this.fee, cashOutInfo.fee) + && Objects.equals(this.isSetFee, cashOutInfo.isSetFee) + && Objects.equals(this.id, cashOutInfo.id) + && Objects.equals(this.isSetId, cashOutInfo.isSetId) + && Objects.equals(this.instructingBalanceAccountId, cashOutInfo.instructingBalanceAccountId) + && Objects.equals( + this.isSetInstructingBalanceAccountId, cashOutInfo.isSetInstructingBalanceAccountId) + && Objects.equals(this.referenceForBeneficiary, cashOutInfo.referenceForBeneficiary) + && Objects.equals( + this.isSetReferenceForBeneficiary, cashOutInfo.isSetReferenceForBeneficiary) + && Objects.equals(this.transferInstrumentId, cashOutInfo.transferInstrumentId) + && Objects.equals(this.isSetTransferInstrumentId, cashOutInfo.isSetTransferInstrumentId); + } + + @Override + public int hashCode() { + return Objects.hash( + amount, + isSetAmount, + counterparty, + isSetCounterparty, + description, + isSetDescription, + fee, + isSetFee, + id, + isSetId, + instructingBalanceAccountId, + isSetInstructingBalanceAccountId, + referenceForBeneficiary, + isSetReferenceForBeneficiary, + transferInstrumentId, + isSetTransferInstrumentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CashOutInfo {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" instructingBalanceAccountId: ") + .append(toIndentedString(instructingBalanceAccountId)) + .append("\n"); + sb.append(" referenceForBeneficiary: ") + .append(toIndentedString(referenceForBeneficiary)) + .append("\n"); + sb.append(" transferInstrumentId: ") + .append(toIndentedString(transferInstrumentId)) + .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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInstructingBalanceAccountId) { + addIfNull( + nulls, JSON_PROPERTY_INSTRUCTING_BALANCE_ACCOUNT_ID, this.instructingBalanceAccountId); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + 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 CashOutInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CashOutInfo + * @throws JsonProcessingException if the JSON string is invalid with respect to CashOutInfo + */ + public static CashOutInfo fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CashOutInfo.class); + } + + /** + * Convert an instance of CashOutInfo to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/transfers/CashOutInfoCounterparty.java b/src/main/java/com/adyen/model/transfers/CashOutInfoCounterparty.java new file mode 100644 index 000000000..5bef90256 --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/CashOutInfoCounterparty.java @@ -0,0 +1,191 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.transfers; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.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.*; + +/** CashOutInfoCounterparty */ +@JsonPropertyOrder({CashOutInfoCounterparty.JSON_PROPERTY_TRANSFER_INSTRUMENT_ID}) +public class CashOutInfoCounterparty { + 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 CashOutInfoCounterparty() {} + + /** + * The unique identifier of the counterparty transfer instrument. If you do not provide this + * field, the cashout funds remain in the instructing balance account after the cashout transfer + * is settled. + * + * @param transferInstrumentId The unique identifier of the counterparty transfer instrument. If + * you do not provide this field, the cashout funds remain in the instructing balance account + * after the cashout transfer is settled. + * @return the current {@code CashOutInfoCounterparty} instance, allowing for method chaining + */ + public CashOutInfoCounterparty transferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + return this; + } + + /** + * The unique identifier of the counterparty transfer instrument. If you do not provide this + * field, the cashout funds remain in the instructing balance account after the cashout transfer + * is settled. + * + * @return transferInstrumentId The unique identifier of the counterparty transfer instrument. If + * you do not provide this field, the cashout funds remain in the instructing balance account + * after the cashout transfer is settled. + */ + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransferInstrumentId() { + return transferInstrumentId; + } + + /** + * The unique identifier of the counterparty transfer instrument. If you do not provide this + * field, the cashout funds remain in the instructing balance account after the cashout transfer + * is settled. + * + * @param transferInstrumentId The unique identifier of the counterparty transfer instrument. If + * you do not provide this field, the cashout funds remain in the instructing balance account + * after the cashout transfer is settled. + */ + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @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 CashOutInfoCounterparty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CashOutInfoCounterparty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CashOutInfoCounterparty cashOutInfoCounterparty = (CashOutInfoCounterparty) o; + return Objects.equals(this.transferInstrumentId, cashOutInfoCounterparty.transferInstrumentId) + && Objects.equals( + this.isSetTransferInstrumentId, cashOutInfoCounterparty.isSetTransferInstrumentId); + } + + @Override + public int hashCode() { + return Objects.hash(transferInstrumentId, isSetTransferInstrumentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CashOutInfoCounterparty {\n"); + sb.append(" transferInstrumentId: ") + .append(toIndentedString(transferInstrumentId)) + .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 (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 CashOutInfoCounterparty given an JSON string + * + * @param jsonString JSON string + * @return An instance of CashOutInfoCounterparty + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CashOutInfoCounterparty + */ + public static CashOutInfoCounterparty fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CashOutInfoCounterparty.class); + } + + /** + * Convert an instance of CashOutInfoCounterparty to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/transfers/CashOutTransfer.java b/src/main/java/com/adyen/model/transfers/CashOutTransfer.java new file mode 100644 index 000000000..33ca43c5b --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/CashOutTransfer.java @@ -0,0 +1,337 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.transfers; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** CashOutTransfer */ +@JsonPropertyOrder({ + CashOutTransfer.JSON_PROPERTY_AMOUNT, + CashOutTransfer.JSON_PROPERTY_ID, + CashOutTransfer.JSON_PROPERTY_TYPE +}) +public class CashOutTransfer { + 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_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * The type of the cashout transfer. Possible values: - **cashoutRepayment**: Corresponds to the + * transfer created to deduct the cashout amount after settlement. - **cashoutFee**: Corresponds + * to the transfer created to debit the cashout fee form the user's balance account. + */ + public enum TypeEnum { + CASHOUTREPAYMENT(String.valueOf("cashoutRepayment")), + + CASHOUTFEE(String.valueOf("cashoutFee")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + 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 CashOutTransfer() {} + + /** + * amount + * + * @param amount + * @return the current {@code CashOutTransfer} instance, allowing for method chaining + */ + public CashOutTransfer amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * The reference of the cashout transfer. + * + * @param id The reference of the cashout transfer. + * @return the current {@code CashOutTransfer} instance, allowing for method chaining + */ + public CashOutTransfer id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The reference of the cashout transfer. + * + * @return id The reference of the cashout transfer. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The reference of the cashout transfer. + * + * @param id The reference of the cashout transfer. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * The type of the cashout transfer. Possible values: - **cashoutRepayment**: Corresponds to the + * transfer created to deduct the cashout amount after settlement. - **cashoutFee**: Corresponds + * to the transfer created to debit the cashout fee form the user's balance account. + * + * @param type The type of the cashout transfer. Possible values: - **cashoutRepayment**: + * Corresponds to the transfer created to deduct the cashout amount after settlement. - + * **cashoutFee**: Corresponds to the transfer created to debit the cashout fee form the + * user's balance account. + * @return the current {@code CashOutTransfer} instance, allowing for method chaining + */ + public CashOutTransfer type(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * The type of the cashout transfer. Possible values: - **cashoutRepayment**: Corresponds to the + * transfer created to deduct the cashout amount after settlement. - **cashoutFee**: Corresponds + * to the transfer created to debit the cashout fee form the user's balance account. + * + * @return type The type of the cashout transfer. Possible values: - **cashoutRepayment**: + * Corresponds to the transfer created to deduct the cashout amount after settlement. - + * **cashoutFee**: Corresponds to the transfer created to debit the cashout fee form the + * user's balance account. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * The type of the cashout transfer. Possible values: - **cashoutRepayment**: Corresponds to the + * transfer created to deduct the cashout amount after settlement. - **cashoutFee**: Corresponds + * to the transfer created to debit the cashout fee form the user's balance account. + * + * @param type The type of the cashout transfer. Possible values: - **cashoutRepayment**: + * Corresponds to the transfer created to deduct the cashout amount after settlement. - + * **cashoutFee**: Corresponds to the transfer created to debit the cashout fee form the + * user's balance account. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @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 CashOutTransfer includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CashOutTransfer object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CashOutTransfer cashOutTransfer = (CashOutTransfer) o; + return Objects.equals(this.amount, cashOutTransfer.amount) + && Objects.equals(this.isSetAmount, cashOutTransfer.isSetAmount) + && Objects.equals(this.id, cashOutTransfer.id) + && Objects.equals(this.isSetId, cashOutTransfer.isSetId) + && Objects.equals(this.type, cashOutTransfer.type) + && Objects.equals(this.isSetType, cashOutTransfer.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash(amount, isSetAmount, id, isSetId, type, isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CashOutTransfer {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + 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 CashOutTransfer given an JSON string + * + * @param jsonString JSON string + * @return An instance of CashOutTransfer + * @throws JsonProcessingException if the JSON string is invalid with respect to CashOutTransfer + */ + public static CashOutTransfer fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CashOutTransfer.class); + } + + /** + * Convert an instance of CashOutTransfer to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/transfers/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/transfers/DefaultErrorResponseEntity.java new file mode 100644 index 000000000..47bcac886 --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/DefaultErrorResponseEntity.java @@ -0,0 +1,547 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.transfers; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.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; + +/** Standardized error response following RFC-7807 format */ +@JsonPropertyOrder({ + DefaultErrorResponseEntity.JSON_PROPERTY_DETAIL, + DefaultErrorResponseEntity.JSON_PROPERTY_ERROR_CODE, + DefaultErrorResponseEntity.JSON_PROPERTY_INSTANCE, + DefaultErrorResponseEntity.JSON_PROPERTY_INVALID_FIELDS, + DefaultErrorResponseEntity.JSON_PROPERTY_REQUEST_ID, + DefaultErrorResponseEntity.JSON_PROPERTY_STATUS, + DefaultErrorResponseEntity.JSON_PROPERTY_TITLE, + DefaultErrorResponseEntity.JSON_PROPERTY_TYPE +}) +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() {} + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity detail(String detail) { + this.detail = detail; + isSetDetail = true; // mark as set + return this; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @return detail A human-readable explanation specific to this occurrence of the problem. + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetail() { + return detail; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(String detail) { + this.detail = detail; + isSetDetail = true; // mark as set + } + + /** + * Unique business error code. + * + * @param errorCode Unique business error code. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity errorCode(String errorCode) { + this.errorCode = errorCode; + isSetErrorCode = true; // mark as set + return this; + } + + /** + * Unique business error code. + * + * @return errorCode Unique business error code. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorCode() { + return errorCode; + } + + /** + * Unique business error code. + * + * @param errorCode Unique business error code. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + isSetErrorCode = true; // mark as set + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @param instance A URI that identifies the specific occurrence of the problem if applicable. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity instance(String instance) { + this.instance = instance; + isSetInstance = true; // mark as set + return this; + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @return instance A URI that identifies the specific occurrence of the problem if applicable. + */ + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstance() { + return instance; + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @param instance A URI that identifies the specific occurrence of the problem if applicable. + */ + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstance(String instance) { + this.instance = instance; + isSetInstance = true; // mark as set + } + + /** + * Array of fields with validation errors when applicable. + * + * @param invalidFields Array of fields with validation errors when applicable. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity invalidFields(List invalidFields) { + this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set + return this; + } + + public DefaultErrorResponseEntity addInvalidFieldsItem(InvalidField invalidFieldsItem) { + if (this.invalidFields == null) { + this.invalidFields = new ArrayList<>(); + } + this.invalidFields.add(invalidFieldsItem); + return this; + } + + /** + * Array of fields with validation errors when applicable. + * + * @return invalidFields Array of fields with validation errors when applicable. + */ + @JsonProperty(JSON_PROPERTY_INVALID_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInvalidFields() { + return invalidFields; + } + + /** + * Array of fields with validation errors when applicable. + * + * @param invalidFields Array of fields with validation errors when applicable. + */ + @JsonProperty(JSON_PROPERTY_INVALID_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvalidFields(List invalidFields) { + this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set + } + + /** + * The unique reference for the request. + * + * @param requestId The unique reference for the request. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity requestId(String requestId) { + this.requestId = requestId; + isSetRequestId = true; // mark as set + return this; + } + + /** + * The unique reference for the request. + * + * @return requestId The unique reference for the request. + */ + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestId() { + return requestId; + } + + /** + * The unique reference for the request. + * + * @param requestId The unique reference for the request. + */ + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestId(String requestId) { + this.requestId = requestId; + isSetRequestId = true; // mark as set + } + + /** + * The HTTP status code. + * + * @param status The HTTP status code. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity status(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * The HTTP status code. + * + * @return status The HTTP status code. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStatus() { + return status; + } + + /** + * The HTTP status code. + * + * @param status The HTTP status code. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * A short, human-readable summary of the problem type. + * + * @param title A short, human-readable summary of the problem type. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity title(String title) { + this.title = title; + isSetTitle = true; // mark as set + return this; + } + + /** + * A short, human-readable summary of the problem type. + * + * @return title A short, human-readable summary of the problem type. + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + /** + * A short, human-readable summary of the problem type. + * + * @param title A short, human-readable summary of the problem type. + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + isSetTitle = true; // mark as set + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @param type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @return type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @param type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @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. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultErrorResponseEntity defaultErrorResponseEntity = (DefaultErrorResponseEntity) o; + return Objects.equals(this.detail, defaultErrorResponseEntity.detail) + && Objects.equals(this.isSetDetail, defaultErrorResponseEntity.isSetDetail) + && Objects.equals(this.errorCode, defaultErrorResponseEntity.errorCode) + && Objects.equals(this.isSetErrorCode, defaultErrorResponseEntity.isSetErrorCode) + && Objects.equals(this.instance, defaultErrorResponseEntity.instance) + && Objects.equals(this.isSetInstance, defaultErrorResponseEntity.isSetInstance) + && Objects.equals(this.invalidFields, defaultErrorResponseEntity.invalidFields) + && Objects.equals(this.isSetInvalidFields, defaultErrorResponseEntity.isSetInvalidFields) + && Objects.equals(this.requestId, defaultErrorResponseEntity.requestId) + && Objects.equals(this.isSetRequestId, defaultErrorResponseEntity.isSetRequestId) + && Objects.equals(this.status, defaultErrorResponseEntity.status) + && Objects.equals(this.isSetStatus, defaultErrorResponseEntity.isSetStatus) + && Objects.equals(this.title, defaultErrorResponseEntity.title) + && Objects.equals(this.isSetTitle, defaultErrorResponseEntity.isSetTitle) + && Objects.equals(this.type, defaultErrorResponseEntity.type) + && Objects.equals(this.isSetType, defaultErrorResponseEntity.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash( + detail, + isSetDetail, + errorCode, + isSetErrorCode, + instance, + isSetInstance, + invalidFields, + isSetInvalidFields, + requestId, + isSetRequestId, + status, + isSetStatus, + title, + isSetTitle, + type, + isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultErrorResponseEntity {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" invalidFields: ").append(toIndentedString(invalidFields)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 (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 + * + * @param jsonString JSON string + * @return An instance of DefaultErrorResponseEntity + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DefaultErrorResponseEntity + */ + public static DefaultErrorResponseEntity fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DefaultErrorResponseEntity.class); + } + + /** + * Convert an instance of DefaultErrorResponseEntity to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/transfers/Modification.java b/src/main/java/com/adyen/model/transfers/Modification.java index 765348761..374039db8 100644 --- a/src/main/java/com/adyen/model/transfers/Modification.java +++ b/src/main/java/com/adyen/model/transfers/Modification.java @@ -52,6 +52,10 @@ public class Modification { /** The status of the transfer event. */ public enum StatusEnum { + ADVICEAUTHORISED(String.valueOf("adviceAuthorised")), + + ADVICEREFUSED(String.valueOf("adviceRefused")), + APPROVALPENDING(String.valueOf("approvalPending")), ATMWITHDRAWAL(String.valueOf("atmWithdrawal")), diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index d06893ded..d3695fb22 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -468,13 +468,17 @@ public static ReasonEnum fromValue(String value) { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is * created. - **refused**: the transfer request is rejected by Adyen for one of the following - * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule - * requirements violated. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: + * the transfer request is authorized and the funds are reserved. - **booked**: the funds are + * deducted from your user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ public enum StatusEnum { + ADVICEAUTHORISED(String.valueOf("adviceAuthorised")), + + ADVICEREFUSED(String.valueOf("adviceRefused")), + APPROVALPENDING(String.valueOf("approvalPending")), ATMWITHDRAWAL(String.valueOf("atmWithdrawal")), @@ -1542,20 +1546,19 @@ public void setReview(TransferReview review) { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is * created. - **refused**: the transfer request is rejected by Adyen for one of the following - * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule - * requirements violated. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: + * the transfer request is authorized and the funds are reserved. - **booked**: the funds are + * deducted from your user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer * request is created. - **refused**: the transfer request is rejected by Adyen for one of the - * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - - * Transaction rule requirements violated. - **authorised**: the transfer request is - * authorized and the funds are reserved. - **booked**: the funds are deducted from your - * user's balance account. - **failed**: the transfer is rejected by the - * counterparty's bank. - **returned**: the transfer is returned by the counterparty's - * bank. + * following reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - + * **authorised**: the transfer request is authorized and the funds are reserved. - + * **booked**: the funds are deducted from your user's balance account. - **failed**: the + * transfer is rejected by the counterparty's bank. - **returned**: the transfer is + * returned by the counterparty's bank. * @return the current {@code Transfer} instance, allowing for method chaining */ public Transfer status(StatusEnum status) { @@ -1567,20 +1570,19 @@ public Transfer status(StatusEnum status) { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is * created. - **refused**: the transfer request is rejected by Adyen for one of the following - * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule - * requirements violated. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: + * the transfer request is authorized and the funds are reserved. - **booked**: the funds are + * deducted from your user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * * @return status The result of the transfer. For example: - **received**: an outgoing transfer * request is created. - **refused**: the transfer request is rejected by Adyen for one of the - * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - - * Transaction rule requirements violated. - **authorised**: the transfer request is - * authorized and the funds are reserved. - **booked**: the funds are deducted from your - * user's balance account. - **failed**: the transfer is rejected by the - * counterparty's bank. - **returned**: the transfer is returned by the counterparty's - * bank. + * following reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - + * **authorised**: the transfer request is authorized and the funds are reserved. - + * **booked**: the funds are deducted from your user's balance account. - **failed**: the + * transfer is rejected by the counterparty's bank. - **returned**: the transfer is + * returned by the counterparty's bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1591,20 +1593,19 @@ public StatusEnum getStatus() { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is * created. - **refused**: the transfer request is rejected by Adyen for one of the following - * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule - * requirements violated. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: + * the transfer request is authorized and the funds are reserved. - **booked**: the funds are + * deducted from your user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer * request is created. - **refused**: the transfer request is rejected by Adyen for one of the - * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - - * Transaction rule requirements violated. - **authorised**: the transfer request is - * authorized and the funds are reserved. - **booked**: the funds are deducted from your - * user's balance account. - **failed**: the transfer is rejected by the - * counterparty's bank. - **returned**: the transfer is returned by the counterparty's - * bank. + * following reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - + * **authorised**: the transfer request is authorized and the funds are reserved. - + * **booked**: the funds are deducted from your user's balance account. - **failed**: the + * transfer is rejected by the counterparty's bank. - **returned**: the transfer is + * returned by the counterparty's bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/transfers/TransferCategoryData.java b/src/main/java/com/adyen/model/transfers/TransferCategoryData.java index 7b9ba6d8c..7953af02f 100644 --- a/src/main/java/com/adyen/model/transfers/TransferCategoryData.java +++ b/src/main/java/com/adyen/model/transfers/TransferCategoryData.java @@ -229,6 +229,18 @@ public TransferCategoryData(PlatformPayment o) { schemas.put("IssuedCard", new GenericType() {}); schemas.put("PlatformPayment", new GenericType() {}); JSON.registerDescendants(TransferCategoryData.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("bank", BankCategoryData.class); + mappings.put("internal", InternalCategoryData.class); + mappings.put("issuedCard", IssuedCard.class); + mappings.put("platformPayment", PlatformPayment.class); + mappings.put("BankCategoryData", BankCategoryData.class); + mappings.put("InternalCategoryData", InternalCategoryData.class); + mappings.put("IssuedCard", IssuedCard.class); + mappings.put("PlatformPayment", PlatformPayment.class); + mappings.put("Transfer_categoryData", TransferCategoryData.class); + JSON.registerDiscriminator(TransferCategoryData.class, "type", mappings); } @Override diff --git a/src/main/java/com/adyen/model/transfers/TransferData.java b/src/main/java/com/adyen/model/transfers/TransferData.java index b09c704be..01d1cfc9a 100644 --- a/src/main/java/com/adyen/model/transfers/TransferData.java +++ b/src/main/java/com/adyen/model/transfers/TransferData.java @@ -515,13 +515,17 @@ public static ReasonEnum fromValue(String value) { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is * created. - **refused**: the transfer request is rejected by Adyen for one of the following - * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule - * requirements violated. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: + * the transfer request is authorized and the funds are reserved. - **booked**: the funds are + * deducted from your user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ public enum StatusEnum { + ADVICEAUTHORISED(String.valueOf("adviceAuthorised")), + + ADVICEREFUSED(String.valueOf("adviceRefused")), + APPROVALPENDING(String.valueOf("approvalPending")), ATMWITHDRAWAL(String.valueOf("atmWithdrawal")), @@ -1851,20 +1855,19 @@ public void setSequenceNumber(Integer sequenceNumber) { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is * created. - **refused**: the transfer request is rejected by Adyen for one of the following - * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule - * requirements violated. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: + * the transfer request is authorized and the funds are reserved. - **booked**: the funds are + * deducted from your user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer * request is created. - **refused**: the transfer request is rejected by Adyen for one of the - * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - - * Transaction rule requirements violated. - **authorised**: the transfer request is - * authorized and the funds are reserved. - **booked**: the funds are deducted from your - * user's balance account. - **failed**: the transfer is rejected by the - * counterparty's bank. - **returned**: the transfer is returned by the counterparty's - * bank. + * following reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - + * **authorised**: the transfer request is authorized and the funds are reserved. - + * **booked**: the funds are deducted from your user's balance account. - **failed**: the + * transfer is rejected by the counterparty's bank. - **returned**: the transfer is + * returned by the counterparty's bank. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData status(StatusEnum status) { @@ -1876,20 +1879,19 @@ public TransferData status(StatusEnum status) { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is * created. - **refused**: the transfer request is rejected by Adyen for one of the following - * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule - * requirements violated. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: + * the transfer request is authorized and the funds are reserved. - **booked**: the funds are + * deducted from your user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * * @return status The result of the transfer. For example: - **received**: an outgoing transfer * request is created. - **refused**: the transfer request is rejected by Adyen for one of the - * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - - * Transaction rule requirements violated. - **authorised**: the transfer request is - * authorized and the funds are reserved. - **booked**: the funds are deducted from your - * user's balance account. - **failed**: the transfer is rejected by the - * counterparty's bank. - **returned**: the transfer is returned by the counterparty's - * bank. + * following reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - + * **authorised**: the transfer request is authorized and the funds are reserved. - + * **booked**: the funds are deducted from your user's balance account. - **failed**: the + * transfer is rejected by the counterparty's bank. - **returned**: the transfer is + * returned by the counterparty's bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1900,20 +1902,19 @@ public StatusEnum getStatus() { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is * created. - **refused**: the transfer request is rejected by Adyen for one of the following - * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule - * requirements violated. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: + * the transfer request is authorized and the funds are reserved. - **booked**: the funds are + * deducted from your user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer * request is created. - **refused**: the transfer request is rejected by Adyen for one of the - * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - - * Transaction rule requirements violated. - **authorised**: the transfer request is - * authorized and the funds are reserved. - **booked**: the funds are deducted from your - * user's balance account. - **failed**: the transfer is rejected by the - * counterparty's bank. - **returned**: the transfer is returned by the counterparty's - * bank. + * following reasons: - Transfer limit exceeded. - Transaction rule requirements violated. - + * **authorised**: the transfer request is authorized and the funds are reserved. - + * **booked**: the funds are deducted from your user's balance account. - **failed**: the + * transfer is rejected by the counterparty's bank. - **returned**: the transfer is + * returned by the counterparty's bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/transfers/TransferDataTracking.java b/src/main/java/com/adyen/model/transfers/TransferDataTracking.java index 1feb2c1d1..a8cafef99 100644 --- a/src/main/java/com/adyen/model/transfers/TransferDataTracking.java +++ b/src/main/java/com/adyen/model/transfers/TransferDataTracking.java @@ -198,6 +198,16 @@ public TransferDataTracking(InternalReviewTrackingData o) { schemas.put("EstimationTrackingData", new GenericType() {}); schemas.put("InternalReviewTrackingData", new GenericType() {}); JSON.registerDescendants(TransferDataTracking.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("confirmation", ConfirmationTrackingData.class); + mappings.put("estimation", EstimationTrackingData.class); + mappings.put("internalReview", InternalReviewTrackingData.class); + mappings.put("ConfirmationTrackingData", ConfirmationTrackingData.class); + mappings.put("EstimationTrackingData", EstimationTrackingData.class); + mappings.put("InternalReviewTrackingData", InternalReviewTrackingData.class); + mappings.put("TransferData_tracking", TransferDataTracking.class); + JSON.registerDiscriminator(TransferDataTracking.class, "type", mappings); } @Override diff --git a/src/main/java/com/adyen/model/transfers/TransferEvent.java b/src/main/java/com/adyen/model/transfers/TransferEvent.java index 129cd898b..5313cfca0 100644 --- a/src/main/java/com/adyen/model/transfers/TransferEvent.java +++ b/src/main/java/com/adyen/model/transfers/TransferEvent.java @@ -330,6 +330,10 @@ public static ReasonEnum fromValue(String value) { /** The status of the transfer event. */ public enum StatusEnum { + ADVICEAUTHORISED(String.valueOf("adviceAuthorised")), + + ADVICEREFUSED(String.valueOf("adviceRefused")), + APPROVALPENDING(String.valueOf("approvalPending")), ATMWITHDRAWAL(String.valueOf("atmWithdrawal")), diff --git a/src/main/java/com/adyen/model/transfers/TransferEventEventsDataInner.java b/src/main/java/com/adyen/model/transfers/TransferEventEventsDataInner.java index 5897feb65..cc42d38e8 100644 --- a/src/main/java/com/adyen/model/transfers/TransferEventEventsDataInner.java +++ b/src/main/java/com/adyen/model/transfers/TransferEventEventsDataInner.java @@ -201,6 +201,16 @@ public TransferEventEventsDataInner(MerchantPurchaseData o) { schemas.put("MerchantPurchaseData", new GenericType() {}); JSON.registerDescendants( TransferEventEventsDataInner.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("interchangeData", InterchangeData.class); + mappings.put("issuingTransactionData", IssuingTransactionData.class); + mappings.put("merchantPurchaseData", MerchantPurchaseData.class); + mappings.put("InterchangeData", InterchangeData.class); + mappings.put("IssuingTransactionData", IssuingTransactionData.class); + mappings.put("MerchantPurchaseData", MerchantPurchaseData.class); + mappings.put("TransferEvent_eventsData_inner", TransferEventEventsDataInner.class); + JSON.registerDiscriminator(TransferEventEventsDataInner.class, "type", mappings); } @Override diff --git a/src/main/java/com/adyen/model/transfers/TransferEventTrackingData.java b/src/main/java/com/adyen/model/transfers/TransferEventTrackingData.java index 90f80c6e2..6a1027998 100644 --- a/src/main/java/com/adyen/model/transfers/TransferEventTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/TransferEventTrackingData.java @@ -199,6 +199,16 @@ public TransferEventTrackingData(InternalReviewTrackingData o) { schemas.put("EstimationTrackingData", new GenericType() {}); schemas.put("InternalReviewTrackingData", new GenericType() {}); JSON.registerDescendants(TransferEventTrackingData.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("confirmation", ConfirmationTrackingData.class); + mappings.put("estimation", EstimationTrackingData.class); + mappings.put("internalReview", InternalReviewTrackingData.class); + mappings.put("ConfirmationTrackingData", ConfirmationTrackingData.class); + mappings.put("EstimationTrackingData", EstimationTrackingData.class); + mappings.put("InternalReviewTrackingData", InternalReviewTrackingData.class); + mappings.put("TransferEvent_trackingData", TransferEventTrackingData.class); + JSON.registerDiscriminator(TransferEventTrackingData.class, "type", mappings); } @Override diff --git a/src/main/java/com/adyen/service/transfers/CapitalApi.java b/src/main/java/com/adyen/service/transfers/CapitalDeprecatedApi.java similarity index 92% rename from src/main/java/com/adyen/service/transfers/CapitalApi.java rename to src/main/java/com/adyen/service/transfers/CapitalDeprecatedApi.java index f2bfb8004..c55e686a0 100644 --- a/src/main/java/com/adyen/service/transfers/CapitalApi.java +++ b/src/main/java/com/adyen/service/transfers/CapitalDeprecatedApi.java @@ -24,31 +24,31 @@ import java.util.HashMap; import java.util.Map; -public class CapitalApi extends Service { +public class CapitalDeprecatedApi extends Service { public static final String API_VERSION = "4"; protected String baseURL; /** - * Capital constructor in {@link com.adyen.service.transfers package}. + * Capital (deprecated) constructor in {@link com.adyen.service.transfers package}. * * @param client {@link Client } (required) */ - public CapitalApi(Client client) { + public CapitalDeprecatedApi(Client client) { super(client); this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/btl/v4"); } /** - * Capital constructor in {@link com.adyen.service.transfers package}. Please use this constructor - * only if you would like to pass along your own url for routing or testing purposes. The latest - * API version is defined in this class as a constant. + * Capital (deprecated) constructor in {@link com.adyen.service.transfers package}. Please use + * this constructor only if you would like to pass along your own url for routing or testing + * purposes. The latest API version is defined in this class as a constant. * * @param client {@link Client } (required) * @param baseURL {@link String } (required) */ - public CapitalApi(Client client, String baseURL) { + public CapitalDeprecatedApi(Client client, String baseURL) { super(client); this.baseURL = baseURL; } diff --git a/src/main/java/com/adyen/service/transfers/CashOutApi.java b/src/main/java/com/adyen/service/transfers/CashOutApi.java new file mode 100644 index 000000000..1c1c305f1 --- /dev/null +++ b/src/main/java/com/adyen/service/transfers/CashOutApi.java @@ -0,0 +1,81 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.transfers; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.RequestOptions; +import com.adyen.model.transfers.CashOut; +import com.adyen.model.transfers.CashOutInfo; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; +import java.io.IOException; + +public class CashOutApi extends Service { + + public static final String API_VERSION = "4"; + + protected String baseURL; + + /** + * CashOut constructor in {@link com.adyen.service.transfers package}. + * + * @param client {@link Client } (required) + */ + public CashOutApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/btl/v4"); + } + + /** + * CashOut constructor in {@link com.adyen.service.transfers package}. Please use this constructor + * only if you would like to pass along your own url for routing or testing purposes. The latest + * API version is defined in this class as a constant. + * + * @param client {@link Client } (required) + * @param baseURL {@link String } (required) + */ + public CashOutApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Initiate a cashout + * + * @param cashOutInfo {@link CashOutInfo } (required) + * @return {@link CashOut } + * @throws ApiException if fails to make API call + */ + public CashOut initiateCashout(CashOutInfo cashOutInfo) throws ApiException, IOException { + return initiateCashout(cashOutInfo, null); + } + + /** + * Initiate a cashout + * + * @param cashOutInfo {@link CashOutInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link CashOut } + * @throws ApiException if fails to make API call + */ + public CashOut initiateCashout(CashOutInfo cashOutInfo, RequestOptions requestOptions) + throws ApiException, IOException { + String requestBody = cashOutInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/cashouts", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CashOut.fromJson(jsonResult); + } +}