diff --git a/sdk-generation-log/balanceplatform.json b/sdk-generation-log/balanceplatform.json new file mode 100644 index 000000000..50a08b7f4 --- /dev/null +++ b/sdk-generation-log/balanceplatform.json @@ -0,0 +1,8 @@ +{ + "service": "balanceplatform", + "project": "java", + "generatedAt": "2026-05-14T14:22:19Z", + "openapiCommitSha": "cbc5406a2df1f24d50e40742f18342f7ca7f21fc", + "automationCommitSha": "6f06b47d0661f0891defe6b85461d2c367fbd284", + "libraryCommitSha": "5790580db2f8a931a68baba2bff9760b8aed2067" +} diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index f5be3e677..25b217341 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -56,8 +56,8 @@ public class AccountHolder { private boolean isSetCapabilities = false; public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; - @Deprecated // deprecated - private ContactDetails contactDetails; + /* deprecated */ + @Deprecated private ContactDetails contactDetails; /** Mark when the attribute has been explicitly set. */ private boolean isSetContactDetails = false; @@ -311,7 +311,7 @@ public void setCapabilities(Map capabilities) { * @return the current {@code AccountHolder} instance, allowing for method chaining * @deprecated */ - @Deprecated // deprecated + @Deprecated public AccountHolder contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; isSetContactDetails = true; // mark as set @@ -322,9 +322,9 @@ public AccountHolder contactDetails(ContactDetails contactDetails) { * Get contactDetails * * @return contactDetails - * @deprecated // deprecated + * @deprecated */ - @Deprecated // deprecated + @Deprecated @JsonProperty(JSON_PROPERTY_CONTACT_DETAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public ContactDetails getContactDetails() { @@ -337,7 +337,7 @@ public ContactDetails getContactDetails() { * @param contactDetails * @deprecated */ - @Deprecated // deprecated + @Deprecated @JsonProperty(JSON_PROPERTY_CONTACT_DETAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java index 83c6f8068..1dd88c077 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java @@ -48,8 +48,8 @@ public class AccountHolderInfo { private boolean isSetCapabilities = false; public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; - @Deprecated // deprecated - private ContactDetails contactDetails; + /* deprecated */ + @Deprecated private ContactDetails contactDetails; /** Mark when the attribute has been explicitly set. */ private boolean isSetContactDetails = false; @@ -225,7 +225,7 @@ public void setCapabilities(Map capabilities) { * @return the current {@code AccountHolderInfo} instance, allowing for method chaining * @deprecated */ - @Deprecated // deprecated + @Deprecated public AccountHolderInfo contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; isSetContactDetails = true; // mark as set @@ -236,9 +236,9 @@ public AccountHolderInfo contactDetails(ContactDetails contactDetails) { * Get contactDetails * * @return contactDetails - * @deprecated // deprecated + * @deprecated */ - @Deprecated // deprecated + @Deprecated @JsonProperty(JSON_PROPERTY_CONTACT_DETAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public ContactDetails getContactDetails() { @@ -251,7 +251,7 @@ public ContactDetails getContactDetails() { * @param contactDetails * @deprecated */ - @Deprecated // deprecated + @Deprecated @JsonProperty(JSON_PROPERTY_CONTACT_DETAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java index 50786293c..658088db6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java @@ -54,8 +54,8 @@ public class AccountHolderUpdateRequest { private boolean isSetCapabilities = false; public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; - @Deprecated // deprecated - private ContactDetails contactDetails; + /* deprecated */ + @Deprecated private ContactDetails contactDetails; /** Mark when the attribute has been explicitly set. */ private boolean isSetContactDetails = false; @@ -297,7 +297,7 @@ public void setCapabilities(Map capabilities) { * @return the current {@code AccountHolderUpdateRequest} instance, allowing for method chaining * @deprecated */ - @Deprecated // deprecated + @Deprecated public AccountHolderUpdateRequest contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; isSetContactDetails = true; // mark as set @@ -308,9 +308,9 @@ public AccountHolderUpdateRequest contactDetails(ContactDetails contactDetails) * Get contactDetails * * @return contactDetails - * @deprecated // deprecated + * @deprecated */ - @Deprecated // deprecated + @Deprecated @JsonProperty(JSON_PROPERTY_CONTACT_DETAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public ContactDetails getContactDetails() { @@ -323,7 +323,7 @@ public ContactDetails getContactDetails() { * @param contactDetails * @deprecated */ - @Deprecated // deprecated + @Deprecated @JsonProperty(JSON_PROPERTY_CONTACT_DETAILS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationStatus.java b/src/main/java/com/adyen/model/balanceplatform/AssociationStatus.java index e4a80744e..4bfee6ec8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationStatus.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationStatus.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** Gets or Sets AssociationStatus */ public enum AssociationStatus { @@ -21,6 +22,8 @@ public enum AssociationStatus { ACTIVE("active"); + private static final Logger LOG = Logger.getLogger(AssociationStatus.class.getName()); + private String value; AssociationStatus(String value) { @@ -44,6 +47,12 @@ public static AssociationStatus fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "AssociationStatus: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(AssociationStatus.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java index e235d62e6..0fb3cbf6a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java @@ -50,8 +50,16 @@ public enum BankAccountIdentificationTypesEnum { IBAN(String.valueOf("iban")), + INLOCAL(String.valueOf("inLocal")), + + JPLOCAL(String.valueOf("jpLocal")), + LEGACY(String.valueOf("legacy")), + MXLOCAL(String.valueOf("mxLocal")), + + MYLOCAL(String.valueOf("myLocal")), + NOLOCAL(String.valueOf("noLocal")), NUMBERANDBIC(String.valueOf("numberAndBic")), diff --git a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java index e3fe67e1d..cc45f897d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java @@ -34,6 +34,7 @@ CardConfiguration.JSON_PROPERTY_LANGUAGE, CardConfiguration.JSON_PROPERTY_LOGO_IMAGE_ID, CardConfiguration.JSON_PROPERTY_PIN_MAILER, + CardConfiguration.JSON_PROPERTY_PRINT_LINE, CardConfiguration.JSON_PROPERTY_SHIPMENT_METHOD }) public class CardConfiguration { @@ -115,6 +116,12 @@ public class CardConfiguration { /** Mark when the attribute has been explicitly set. */ private boolean isSetPinMailer = false; + public static final String JSON_PROPERTY_PRINT_LINE = "printLine"; + private String printLine; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrintLine = false; + public static final String JSON_PROPERTY_SHIPMENT_METHOD = "shipmentMethod"; private String shipmentMethod; @@ -698,6 +705,47 @@ public void setPinMailer(String pinMailer) { isSetPinMailer = true; // mark as set } + /** + * Print Line. Text printed on the physical card below the cardholder name. You provide the value, + * which can be up to 26 characters. + * + * @param printLine Print Line. Text printed on the physical card below the cardholder name. You + * provide the value, which can be up to 26 characters. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration printLine(String printLine) { + this.printLine = printLine; + isSetPrintLine = true; // mark as set + return this; + } + + /** + * Print Line. Text printed on the physical card below the cardholder name. You provide the value, + * which can be up to 26 characters. + * + * @return printLine Print Line. Text printed on the physical card below the cardholder name. You + * provide the value, which can be up to 26 characters. + */ + @JsonProperty(JSON_PROPERTY_PRINT_LINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrintLine() { + return printLine; + } + + /** + * Print Line. Text printed on the physical card below the cardholder name. You provide the value, + * which can be up to 26 characters. + * + * @param printLine Print Line. Text printed on the physical card below the cardholder name. You + * provide the value, which can be up to 26 characters. + */ + @JsonProperty(JSON_PROPERTY_PRINT_LINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrintLine(String printLine) { + this.printLine = printLine; + isSetPrintLine = true; // mark as set + } + /** * The logistics company that ships the card. This field overrides the logistics company defined * in the card configuration profile. @@ -796,6 +844,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetLogoImageId, cardConfiguration.isSetLogoImageId) && Objects.equals(this.pinMailer, cardConfiguration.pinMailer) && Objects.equals(this.isSetPinMailer, cardConfiguration.isSetPinMailer) + && Objects.equals(this.printLine, cardConfiguration.printLine) + && Objects.equals(this.isSetPrintLine, cardConfiguration.isSetPrintLine) && Objects.equals(this.shipmentMethod, cardConfiguration.shipmentMethod) && Objects.equals(this.isSetShipmentMethod, cardConfiguration.isSetShipmentMethod); } @@ -829,6 +879,8 @@ public int hashCode() { isSetLogoImageId, pinMailer, isSetPinMailer, + printLine, + isSetPrintLine, shipmentMethod, isSetShipmentMethod); } @@ -852,6 +904,7 @@ public String toString() { sb.append(" language: ").append(toIndentedString(language)).append("\n"); sb.append(" logoImageId: ").append(toIndentedString(logoImageId)).append("\n"); sb.append(" pinMailer: ").append(toIndentedString(pinMailer)).append("\n"); + sb.append(" printLine: ").append(toIndentedString(printLine)).append("\n"); sb.append(" shipmentMethod: ").append(toIndentedString(shipmentMethod)).append("\n"); sb.append("}"); return sb.toString(); @@ -916,6 +969,9 @@ public Map getExplicitNulls() { if (isSetPinMailer) { addIfNull(nulls, JSON_PROPERTY_PIN_MAILER, this.pinMailer); } + if (isSetPrintLine) { + addIfNull(nulls, JSON_PROPERTY_PRINT_LINE, this.printLine); + } if (isSetShipmentMethod) { addIfNull(nulls, JSON_PROPERTY_SHIPMENT_METHOD, this.shipmentMethod); } diff --git a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java index 51528b842..b19c8c029 100644 --- a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java @@ -25,10 +25,17 @@ /** IbanAccountIdentification */ @JsonPropertyOrder({ + IbanAccountIdentification.JSON_PROPERTY_BIC, IbanAccountIdentification.JSON_PROPERTY_IBAN, IbanAccountIdentification.JSON_PROPERTY_TYPE }) public class IbanAccountIdentification { + public static final String JSON_PROPERTY_BIC = "bic"; + private String bic; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; @@ -88,6 +95,41 @@ public static TypeEnum fromValue(String value) { public IbanAccountIdentification() {} + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @param bic The bank's 8- or 11-character BIC or SWIFT code. + * @return the current {@code IbanAccountIdentification} instance, allowing for method chaining + */ + public IbanAccountIdentification bic(String bic) { + this.bic = bic; + isSetBic = true; // mark as set + return this; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @return bic The bank's 8- or 11-character BIC or SWIFT code. + */ + @JsonProperty(JSON_PROPERTY_BIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBic() { + return bic; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @param bic The bank's 8- or 11-character BIC or SWIFT code. + */ + @JsonProperty(JSON_PROPERTY_BIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBic(String bic) { + this.bic = bic; + isSetBic = true; // mark as set + } + /** * The international bank account number as defined in the * [ISO-13616](https://www.iso.org/standard/81090.html) standard. @@ -194,7 +236,9 @@ public boolean equals(Object o) { return false; } IbanAccountIdentification ibanAccountIdentification = (IbanAccountIdentification) o; - return Objects.equals(this.iban, ibanAccountIdentification.iban) + return Objects.equals(this.bic, ibanAccountIdentification.bic) + && Objects.equals(this.isSetBic, ibanAccountIdentification.isSetBic) + && Objects.equals(this.iban, ibanAccountIdentification.iban) && Objects.equals(this.isSetIban, ibanAccountIdentification.isSetIban) && Objects.equals(this.type, ibanAccountIdentification.type) && Objects.equals(this.isSetType, ibanAccountIdentification.isSetType); @@ -202,13 +246,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(iban, isSetIban, type, isSetType); + return Objects.hash(bic, isSetBic, iban, isSetIban, type, isSetType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IbanAccountIdentification {\n"); + sb.append(" bic: ").append(toIndentedString(bic)).append("\n"); sb.append(" iban: ").append(toIndentedString(iban)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); @@ -235,6 +280,9 @@ public Map getExplicitNulls() { Map nulls = new HashMap<>(); + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } if (isSetIban) { addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); } diff --git a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java index ec1fa4f67..fdbb00344 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java +++ b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java @@ -21,11 +21,17 @@ /** InvalidField */ @JsonPropertyOrder({ + InvalidField.JSON_PROPERTY_MESSAGE, InvalidField.JSON_PROPERTY_NAME, - InvalidField.JSON_PROPERTY_VALUE, - InvalidField.JSON_PROPERTY_MESSAGE + InvalidField.JSON_PROPERTY_VALUE }) public class InvalidField { + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -38,12 +44,6 @@ public class InvalidField { /** Mark when the attribute has been explicitly set. */ private boolean isSetValue = false; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; - - /** Mark when the attribute has been explicitly set. */ - private boolean isSetMessage = false; - /** * Sets whether attributes with null values should be explicitly included in the JSON payload. * Default is false. @@ -52,6 +52,41 @@ public class InvalidField { public InvalidField() {} + /** + * Description of the validation error. + * + * @param message Description of the validation error. + * @return the current {@code InvalidField} instance, allowing for method chaining + */ + public InvalidField message(String message) { + this.message = message; + isSetMessage = true; // mark as set + return this; + } + + /** + * Description of the validation error. + * + * @return message Description of the validation error. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + /** + * Description of the validation error. + * + * @param message Description of the validation error. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + isSetMessage = true; // mark as set + } + /** * The field that has an invalid value. * @@ -122,41 +157,6 @@ public void setValue(String value) { isSetValue = true; // mark as set } - /** - * Description of the validation error. - * - * @param message Description of the validation error. - * @return the current {@code InvalidField} instance, allowing for method chaining - */ - public InvalidField message(String message) { - this.message = message; - isSetMessage = true; // mark as set - return this; - } - - /** - * Description of the validation error. - * - * @return message Description of the validation error. - */ - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { - return message; - } - - /** - * Description of the validation error. - * - * @param message Description of the validation error. - */ - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - isSetMessage = true; // mark as set - } - /** * Configures whether null values are explicitly serialized in the JSON payload. Default is false. */ @@ -187,26 +187,26 @@ public boolean equals(Object o) { return false; } InvalidField invalidField = (InvalidField) o; - return Objects.equals(this.name, invalidField.name) + return Objects.equals(this.message, invalidField.message) + && Objects.equals(this.isSetMessage, invalidField.isSetMessage) + && Objects.equals(this.name, invalidField.name) && Objects.equals(this.isSetName, invalidField.isSetName) && Objects.equals(this.value, invalidField.value) - && Objects.equals(this.isSetValue, invalidField.isSetValue) - && Objects.equals(this.message, invalidField.message) - && Objects.equals(this.isSetMessage, invalidField.isSetMessage); + && Objects.equals(this.isSetValue, invalidField.isSetValue); } @Override public int hashCode() { - return Objects.hash(name, isSetName, value, isSetValue, message, isSetMessage); + return Objects.hash(message, isSetMessage, name, isSetName, value, isSetValue); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class InvalidField {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append("}"); return sb.toString(); } @@ -231,15 +231,15 @@ public Map getExplicitNulls() { Map nulls = new HashMap<>(); + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } if (isSetName) { addIfNull(nulls, JSON_PROPERTY_NAME, this.name); } if (isSetValue) { addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); } - if (isSetMessage) { - addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); - } return nulls; } diff --git a/src/main/java/com/adyen/model/balanceplatform/LimitStatus.java b/src/main/java/com/adyen/model/balanceplatform/LimitStatus.java index f76dfacf5..4003c3c61 100644 --- a/src/main/java/com/adyen/model/balanceplatform/LimitStatus.java +++ b/src/main/java/com/adyen/model/balanceplatform/LimitStatus.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** * The status of the transfer limit. Possible values: * **active**: the limit is currently active. * @@ -29,6 +30,8 @@ public enum LimitStatus { SCHEDULED("scheduled"); + private static final Logger LOG = Logger.getLogger(LimitStatus.class.getName()); + private String value; LimitStatus(String value) { @@ -52,6 +55,12 @@ public static LimitStatus fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "LimitStatus: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(LimitStatus.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/ListMandatesResponse.java b/src/main/java/com/adyen/model/balanceplatform/ListMandatesResponse.java new file mode 100644 index 000000000..076422a76 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/ListMandatesResponse.java @@ -0,0 +1,236 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** ListMandatesResponse */ +@JsonPropertyOrder({ + ListMandatesResponse.JSON_PROPERTY_LINK, + ListMandatesResponse.JSON_PROPERTY_MANDATES +}) +public class ListMandatesResponse { + public static final String JSON_PROPERTY_LINK = "link"; + private Link link; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLink = false; + + public static final String JSON_PROPERTY_MANDATES = "mandates"; + private List mandates; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandates = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ListMandatesResponse() {} + + /** + * link + * + * @param link + * @return the current {@code ListMandatesResponse} instance, allowing for method chaining + */ + public ListMandatesResponse link(Link link) { + this.link = link; + isSetLink = true; // mark as set + return this; + } + + /** + * Get link + * + * @return link + */ + @JsonProperty(JSON_PROPERTY_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Link getLink() { + return link; + } + + /** + * link + * + * @param link + */ + @JsonProperty(JSON_PROPERTY_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLink(Link link) { + this.link = link; + isSetLink = true; // mark as set + } + + /** + * Contains a list of the mandates. + * + * @param mandates Contains a list of the mandates. + * @return the current {@code ListMandatesResponse} instance, allowing for method chaining + */ + public ListMandatesResponse mandates(List mandates) { + this.mandates = mandates; + isSetMandates = true; // mark as set + return this; + } + + public ListMandatesResponse addMandatesItem(Mandate mandatesItem) { + if (this.mandates == null) { + this.mandates = new ArrayList<>(); + } + this.mandates.add(mandatesItem); + return this; + } + + /** + * Contains a list of the mandates. + * + * @return mandates Contains a list of the mandates. + */ + @JsonProperty(JSON_PROPERTY_MANDATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMandates() { + return mandates; + } + + /** + * Contains a list of the mandates. + * + * @param mandates Contains a list of the mandates. + */ + @JsonProperty(JSON_PROPERTY_MANDATES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMandates(List mandates) { + this.mandates = mandates; + isSetMandates = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListMandatesResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ListMandatesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListMandatesResponse listMandatesResponse = (ListMandatesResponse) o; + return Objects.equals(this.link, listMandatesResponse.link) + && Objects.equals(this.isSetLink, listMandatesResponse.isSetLink) + && Objects.equals(this.mandates, listMandatesResponse.mandates) + && Objects.equals(this.isSetMandates, listMandatesResponse.isSetMandates); + } + + @Override + public int hashCode() { + return Objects.hash(link, isSetLink, mandates, isSetMandates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListMandatesResponse {\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" mandates: ").append(toIndentedString(mandates)).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 (isSetLink) { + addIfNull(nulls, JSON_PROPERTY_LINK, this.link); + } + if (isSetMandates) { + addIfNull(nulls, JSON_PROPERTY_MANDATES, this.mandates); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ListMandatesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListMandatesResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ListMandatesResponse + */ + public static ListMandatesResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ListMandatesResponse.class); + } + + /** + * Convert an instance of ListMandatesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/Mandate.java b/src/main/java/com/adyen/model/balanceplatform/Mandate.java new file mode 100644 index 000000000..e38c5d46e --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/Mandate.java @@ -0,0 +1,538 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; + +/** Mandate */ +@JsonPropertyOrder({ + Mandate.JSON_PROPERTY_BALANCE_ACCOUNT_ID, + Mandate.JSON_PROPERTY_COUNTERPARTY, + Mandate.JSON_PROPERTY_CREATED_AT, + Mandate.JSON_PROPERTY_ID, + Mandate.JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, + Mandate.JSON_PROPERTY_STATUS, + Mandate.JSON_PROPERTY_TYPE, + Mandate.JSON_PROPERTY_UPDATED_AT +}) +public class Mandate { + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; + private String balanceAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; + private MandateBankAccount counterparty; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; + private String paymentInstrumentId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + + public static final String JSON_PROPERTY_STATUS = "status"; + private MandateStatus status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MandateType type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; + private OffsetDateTime updatedAt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdatedAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Mandate() {} + + /** + * The unique identifier of the balance account linked to the payment instrument. + * + * @param balanceAccountId The unique identifier of the balance account linked to the payment + * instrument. + * @return the current {@code Mandate} instance, allowing for method chaining + */ + public Mandate balanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set + return this; + } + + /** + * The unique identifier of the balance account linked to the payment instrument. + * + * @return balanceAccountId The unique identifier of the balance account linked to the payment + * instrument. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBalanceAccountId() { + return balanceAccountId; + } + + /** + * The unique identifier of the balance account linked to the payment instrument. + * + * @param balanceAccountId The unique identifier of the balance account linked to the payment + * instrument. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set + } + + /** + * counterparty + * + * @param counterparty + * @return the current {@code Mandate} instance, allowing for method chaining + */ + public Mandate counterparty(MandateBankAccount 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 MandateBankAccount getCounterparty() { + return counterparty; + } + + /** + * counterparty + * + * @param counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCounterparty(MandateBankAccount counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + } + + /** + * The date when the mandate was created. + * + * @param createdAt The date when the mandate was created. + * @return the current {@code Mandate} instance, allowing for method chaining + */ + public Mandate createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set + return this; + } + + /** + * The date when the mandate was created. + * + * @return createdAt The date when the mandate was created. + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * The date when the mandate was created. + * + * @param createdAt The date when the mandate was created. + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set + } + + /** + * The unique identifier of the mandate. + * + * @param id The unique identifier of the mandate. + * @return the current {@code Mandate} instance, allowing for method chaining + */ + public Mandate id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the mandate. + * + * @return id The unique identifier of the mandate. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the mandate. + * + * @param id The unique identifier of the mandate. + */ + @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 payment instrument linked to the mandate. + * + * @param paymentInstrumentId The unique identifier of the payment instrument linked to the + * mandate. + * @return the current {@code Mandate} instance, allowing for method chaining + */ + public Mandate paymentInstrumentId(String paymentInstrumentId) { + this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + return this; + } + + /** + * The unique identifier of the payment instrument linked to the mandate. + * + * @return paymentInstrumentId The unique identifier of the payment instrument linked to the + * mandate. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPaymentInstrumentId() { + return paymentInstrumentId; + } + + /** + * The unique identifier of the payment instrument linked to the mandate. + * + * @param paymentInstrumentId The unique identifier of the payment instrument linked to the + * mandate. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentId(String paymentInstrumentId) { + this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + } + + /** + * status + * + * @param status + * @return the current {@code Mandate} instance, allowing for method chaining + */ + public Mandate status(MandateStatus status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * Get status + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MandateStatus getStatus() { + return status; + } + + /** + * status + * + * @param status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(MandateStatus status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * type + * + * @param type + * @return the current {@code Mandate} instance, allowing for method chaining + */ + public Mandate type(MandateType type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Get type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MandateType getType() { + return type; + } + + /** + * type + * + * @param type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(MandateType type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * The date when the mandate was updated. + * + * @param updatedAt The date when the mandate was updated. + * @return the current {@code Mandate} instance, allowing for method chaining + */ + public Mandate updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set + return this; + } + + /** + * The date when the mandate was updated. + * + * @return updatedAt The date when the mandate was updated. + */ + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * The date when the mandate was updated. + * + * @param updatedAt The date when the mandate was updated. + */ + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Mandate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Mandate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Mandate mandate = (Mandate) o; + return Objects.equals(this.balanceAccountId, mandate.balanceAccountId) + && Objects.equals(this.isSetBalanceAccountId, mandate.isSetBalanceAccountId) + && Objects.equals(this.counterparty, mandate.counterparty) + && Objects.equals(this.isSetCounterparty, mandate.isSetCounterparty) + && Objects.equals(this.createdAt, mandate.createdAt) + && Objects.equals(this.isSetCreatedAt, mandate.isSetCreatedAt) + && Objects.equals(this.id, mandate.id) + && Objects.equals(this.isSetId, mandate.isSetId) + && Objects.equals(this.paymentInstrumentId, mandate.paymentInstrumentId) + && Objects.equals(this.isSetPaymentInstrumentId, mandate.isSetPaymentInstrumentId) + && Objects.equals(this.status, mandate.status) + && Objects.equals(this.isSetStatus, mandate.isSetStatus) + && Objects.equals(this.type, mandate.type) + && Objects.equals(this.isSetType, mandate.isSetType) + && Objects.equals(this.updatedAt, mandate.updatedAt) + && Objects.equals(this.isSetUpdatedAt, mandate.isSetUpdatedAt); + } + + @Override + public int hashCode() { + return Objects.hash( + balanceAccountId, + isSetBalanceAccountId, + counterparty, + isSetCounterparty, + createdAt, + isSetCreatedAt, + id, + isSetId, + paymentInstrumentId, + isSetPaymentInstrumentId, + status, + isSetStatus, + type, + isSetType, + updatedAt, + isSetUpdatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Mandate {\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" paymentInstrumentId: ") + .append(toIndentedString(paymentInstrumentId)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdatedAt) { + addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Mandate given an JSON string + * + * @param jsonString JSON string + * @return An instance of Mandate + * @throws JsonProcessingException if the JSON string is invalid with respect to Mandate + */ + public static Mandate fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Mandate.class); + } + + /** + * Convert an instance of Mandate to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/MandateAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/MandateAccountIdentification.java new file mode 100644 index 000000000..f1f902565 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/MandateAccountIdentification.java @@ -0,0 +1,202 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** MandateAccountIdentification */ +@JsonPropertyOrder({MandateAccountIdentification.JSON_PROPERTY_TYPE}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = UKLocalMandateAccountIdentification.class, name = "ukLocal"), +}) +public class MandateAccountIdentification { + 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 MandateAccountIdentification() {} + + /** + * type + * + * @param type + * @return the current {@code MandateAccountIdentification} instance, allowing for method chaining + */ + public MandateAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Get type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * type + * + * @param 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 MandateAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this MandateAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MandateAccountIdentification mandateAccountIdentification = (MandateAccountIdentification) o; + return Objects.equals(this.type, mandateAccountIdentification.type) + && Objects.equals(this.isSetType, mandateAccountIdentification.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash(type, isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MandateAccountIdentification {\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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ukLocal", UKLocalMandateAccountIdentification.class); + mappings.put("MandateAccountIdentification", MandateAccountIdentification.class); + JSON.registerDiscriminator(MandateAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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 MandateAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of MandateAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * MandateAccountIdentification + */ + public static MandateAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MandateAccountIdentification.class); + } + + /** + * Convert an instance of MandateAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/MandateBankAccount.java b/src/main/java/com/adyen/model/balanceplatform/MandateBankAccount.java new file mode 100644 index 000000000..77fc004c5 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/MandateBankAccount.java @@ -0,0 +1,231 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** MandateBankAccount */ +@JsonPropertyOrder({ + MandateBankAccount.JSON_PROPERTY_ACCOUNT_HOLDER, + MandateBankAccount.JSON_PROPERTY_ACCOUNT_IDENTIFICATION +}) +public class MandateBankAccount { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; + private MandatePartyIdentification accountHolder; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + + public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; + private MandateAccountIdentification accountIdentification; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public MandateBankAccount() {} + + /** + * accountHolder + * + * @param accountHolder + * @return the current {@code MandateBankAccount} instance, allowing for method chaining + */ + public MandateBankAccount accountHolder(MandatePartyIdentification accountHolder) { + this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set + return this; + } + + /** + * Get accountHolder + * + * @return accountHolder + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MandatePartyIdentification getAccountHolder() { + return accountHolder; + } + + /** + * accountHolder + * + * @param accountHolder + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolder(MandatePartyIdentification accountHolder) { + this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set + } + + /** + * accountIdentification + * + * @param accountIdentification + * @return the current {@code MandateBankAccount} instance, allowing for method chaining + */ + public MandateBankAccount accountIdentification( + MandateAccountIdentification accountIdentification) { + this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + return this; + } + + /** + * Get accountIdentification + * + * @return accountIdentification + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MandateAccountIdentification getAccountIdentification() { + return accountIdentification; + } + + /** + * accountIdentification + * + * @param accountIdentification + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountIdentification(MandateAccountIdentification accountIdentification) { + this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MandateBankAccount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this MandateBankAccount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MandateBankAccount mandateBankAccount = (MandateBankAccount) o; + return Objects.equals(this.accountHolder, mandateBankAccount.accountHolder) + && Objects.equals(this.isSetAccountHolder, mandateBankAccount.isSetAccountHolder) + && Objects.equals(this.accountIdentification, mandateBankAccount.accountIdentification) + && Objects.equals( + this.isSetAccountIdentification, mandateBankAccount.isSetAccountIdentification); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolder, isSetAccountHolder, accountIdentification, isSetAccountIdentification); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MandateBankAccount {\n"); + sb.append(" accountHolder: ").append(toIndentedString(accountHolder)).append("\n"); + sb.append(" accountIdentification: ") + .append(toIndentedString(accountIdentification)) + .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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of MandateBankAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of MandateBankAccount + * @throws JsonProcessingException if the JSON string is invalid with respect to + * MandateBankAccount + */ + public static MandateBankAccount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MandateBankAccount.class); + } + + /** + * Convert an instance of MandateBankAccount to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/MandatePartyIdentification.java b/src/main/java/com/adyen/model/balanceplatform/MandatePartyIdentification.java new file mode 100644 index 000000000..5569a0afb --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/MandatePartyIdentification.java @@ -0,0 +1,183 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** MandatePartyIdentification */ +@JsonPropertyOrder({MandatePartyIdentification.JSON_PROPERTY_FULL_NAME}) +public class MandatePartyIdentification { + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; + private String fullName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public MandatePartyIdentification() {} + + /** + * The full name of the entity that owns the bank account. Supported characters: [a-z] [A-Z] [0-9] + * , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. + * + * @param fullName The full name of the entity that owns the bank account. Supported characters: + * [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. + * @return the current {@code MandatePartyIdentification} instance, allowing for method chaining + */ + public MandatePartyIdentification fullName(String fullName) { + this.fullName = fullName; + isSetFullName = true; // mark as set + return this; + } + + /** + * The full name of the entity that owns the bank account. Supported characters: [a-z] [A-Z] [0-9] + * , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. + * + * @return fullName The full name of the entity that owns the bank account. Supported characters: + * [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. + */ + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFullName() { + return fullName; + } + + /** + * The full name of the entity that owns the bank account. Supported characters: [a-z] [A-Z] [0-9] + * , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. + * + * @param fullName The full name of the entity that owns the bank account. Supported characters: + * [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. + */ + @JsonProperty(JSON_PROPERTY_FULL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFullName(String fullName) { + this.fullName = fullName; + isSetFullName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MandatePartyIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this MandatePartyIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MandatePartyIdentification mandatePartyIdentification = (MandatePartyIdentification) o; + return Objects.equals(this.fullName, mandatePartyIdentification.fullName) + && Objects.equals(this.isSetFullName, mandatePartyIdentification.isSetFullName); + } + + @Override + public int hashCode() { + return Objects.hash(fullName, isSetFullName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MandatePartyIdentification {\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).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 (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of MandatePartyIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of MandatePartyIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * MandatePartyIdentification + */ + public static MandatePartyIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MandatePartyIdentification.class); + } + + /** + * Convert an instance of MandatePartyIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/MandateStatus.java b/src/main/java/com/adyen/model/balanceplatform/MandateStatus.java new file mode 100644 index 000000000..ea7c22f04 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/MandateStatus.java @@ -0,0 +1,60 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; +import java.util.logging.Logger; + +/** Gets or Sets MandateStatus */ +public enum MandateStatus { + PENDING("pending"), + + APPROVED("approved"), + + CANCELLED("cancelled"); + + private static final Logger LOG = Logger.getLogger(MandateStatus.class.getName()); + + private String value; + + MandateStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MandateStatus fromValue(String value) { + for (MandateStatus b : MandateStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "MandateStatus: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(MandateStatus.values())); + return null; + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/MandateType.java b/src/main/java/com/adyen/model/balanceplatform/MandateType.java new file mode 100644 index 000000000..8f846187d --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/MandateType.java @@ -0,0 +1,56 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; +import java.util.logging.Logger; + +/** Gets or Sets MandateType */ +public enum MandateType { + BACS("bacs"); + + private static final Logger LOG = Logger.getLogger(MandateType.class.getName()); + + private String value; + + MandateType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MandateType fromValue(String value) { + for (MandateType b : MandateType.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "MandateType: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(MandateType.values())); + return null; + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/MandateUpdate.java b/src/main/java/com/adyen/model/balanceplatform/MandateUpdate.java new file mode 100644 index 000000000..1ceac99ba --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/MandateUpdate.java @@ -0,0 +1,180 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** MandateUpdate */ +@JsonPropertyOrder({MandateUpdate.JSON_PROPERTY_PAYMENT_INSTRUMENT_ID}) +public class MandateUpdate { + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; + private Object paymentInstrumentId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public MandateUpdate() {} + + /** + * The unique identifier of the payment instrument linked to the mandate. + * + * @param paymentInstrumentId The unique identifier of the payment instrument linked to the + * mandate. + * @return the current {@code MandateUpdate} instance, allowing for method chaining + */ + public MandateUpdate paymentInstrumentId(Object paymentInstrumentId) { + this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + return this; + } + + /** + * The unique identifier of the payment instrument linked to the mandate. + * + * @return paymentInstrumentId The unique identifier of the payment instrument linked to the + * mandate. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getPaymentInstrumentId() { + return paymentInstrumentId; + } + + /** + * The unique identifier of the payment instrument linked to the mandate. + * + * @param paymentInstrumentId The unique identifier of the payment instrument linked to the + * mandate. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentId(Object paymentInstrumentId) { + this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MandateUpdate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this MandateUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MandateUpdate mandateUpdate = (MandateUpdate) o; + return Objects.equals(this.paymentInstrumentId, mandateUpdate.paymentInstrumentId) + && Objects.equals(this.isSetPaymentInstrumentId, mandateUpdate.isSetPaymentInstrumentId); + } + + @Override + public int hashCode() { + return Objects.hash(paymentInstrumentId, isSetPaymentInstrumentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MandateUpdate {\n"); + sb.append(" paymentInstrumentId: ") + .append(toIndentedString(paymentInstrumentId)) + .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 (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of MandateUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of MandateUpdate + * @throws JsonProcessingException if the JSON string is invalid with respect to MandateUpdate + */ + public static MandateUpdate fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MandateUpdate.class); + } + + /** + * Convert an instance of MandateUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java index cc456a79f..94330cba6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java @@ -46,7 +46,9 @@ public class PaymentInstrument { public static final String JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS = "additionalBankAccountIdentifications"; - @Deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + + /* deprecated since Configuration API v2: Please use `bankAccount` object instead */ + @Deprecated private List additionalBankAccountIdentifications; @@ -308,9 +310,9 @@ public PaymentInstrument() {} * details. Returned when you create a payment instrument with `type` * **bankAccount**. * @return the current {@code PaymentInstrument} instance, allowing for method chaining - * @deprecated since Configuration API v2 Please use `bankAccount` object instead + * @deprecated since Configuration API v2 Please use `bankAccount` object instead */ - @Deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + @Deprecated public PaymentInstrument additionalBankAccountIdentifications( List additionalBankAccountIdentifications) { @@ -336,9 +338,9 @@ public PaymentInstrument addAdditionalBankAccountIdentificationsItem( * @return additionalBankAccountIdentifications Contains optional, additional business account * details. Returned when you create a payment instrument with `type` * **bankAccount**. - * @deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + * @deprecated since Configuration API v2 Please use `bankAccount` object instead */ - @Deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + @Deprecated @JsonProperty(JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List @@ -353,9 +355,9 @@ public PaymentInstrument addAdditionalBankAccountIdentificationsItem( * @param additionalBankAccountIdentifications Contains optional, additional business account * details. Returned when you create a payment instrument with `type` * **bankAccount**. - * @deprecated since Configuration API v2 Please use `bankAccount` object instead + * @deprecated since Configuration API v2 Please use `bankAccount` object instead */ - @Deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + @Deprecated @JsonProperty(JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalBankAccountIdentifications( diff --git a/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java index 6cfc19aa3..3df242092 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java +++ b/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java @@ -94,11 +94,14 @@ public void setSalesDayClosingTime(String salesDayClosingTime) { /** * Specifies after how many business days the funds in a settlement batch are made available in - * this balance account. Possible values: **1** to **20**, or **null**. Default value: **null**. + * this balance account. Requires Custom Sales Day Payout to be enabled for your balance account. + * Contact your account manager or implementation manager to enable this. Possible values: **1** + * to **20**, or **null**. Default value: **null**. * * @param settlementDelayDays Specifies after how many business days the funds in a settlement - * batch are made available in this balance account. Possible values: **1** to **20**, or - * **null**. Default value: **null**. + * batch are made available in this balance account. Requires Custom Sales Day Payout to be + * enabled for your balance account. Contact your account manager or implementation manager to + * enable this. Possible values: **1** to **20**, or **null**. Default value: **null**. * @return the current {@code PlatformPaymentConfiguration} instance, allowing for method chaining */ public PlatformPaymentConfiguration settlementDelayDays(Integer settlementDelayDays) { @@ -109,11 +112,14 @@ public PlatformPaymentConfiguration settlementDelayDays(Integer settlementDelayD /** * Specifies after how many business days the funds in a settlement batch are made available in - * this balance account. Possible values: **1** to **20**, or **null**. Default value: **null**. + * this balance account. Requires Custom Sales Day Payout to be enabled for your balance account. + * Contact your account manager or implementation manager to enable this. Possible values: **1** + * to **20**, or **null**. Default value: **null**. * * @return settlementDelayDays Specifies after how many business days the funds in a settlement - * batch are made available in this balance account. Possible values: **1** to **20**, or - * **null**. Default value: **null**. + * batch are made available in this balance account. Requires Custom Sales Day Payout to be + * enabled for your balance account. Contact your account manager or implementation manager to + * enable this. Possible values: **1** to **20**, or **null**. Default value: **null**. */ @JsonProperty(JSON_PROPERTY_SETTLEMENT_DELAY_DAYS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,11 +129,14 @@ public Integer getSettlementDelayDays() { /** * Specifies after how many business days the funds in a settlement batch are made available in - * this balance account. Possible values: **1** to **20**, or **null**. Default value: **null**. + * this balance account. Requires Custom Sales Day Payout to be enabled for your balance account. + * Contact your account manager or implementation manager to enable this. Possible values: **1** + * to **20**, or **null**. Default value: **null**. * * @param settlementDelayDays Specifies after how many business days the funds in a settlement - * batch are made available in this balance account. Possible values: **1** to **20**, or - * **null**. Default value: **null**. + * batch are made available in this balance account. Requires Custom Sales Day Payout to be + * enabled for your balance account. Contact your account manager or implementation manager to + * enable this. Possible values: **1** to **20**, or **null**. Default value: **null**. */ @JsonProperty(JSON_PROPERTY_SETTLEMENT_DELAY_DAYS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaDeviceType.java b/src/main/java/com/adyen/model/balanceplatform/ScaDeviceType.java index 8f1613422..e2471c87d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaDeviceType.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaDeviceType.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** Gets or Sets ScaDeviceType */ public enum ScaDeviceType { @@ -23,6 +24,8 @@ public enum ScaDeviceType { ANDROID("android"); + private static final Logger LOG = Logger.getLogger(ScaDeviceType.class.getName()); + private String value; ScaDeviceType(String value) { @@ -46,6 +49,12 @@ public static ScaDeviceType fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "ScaDeviceType: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ScaDeviceType.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaEntityType.java b/src/main/java/com/adyen/model/balanceplatform/ScaEntityType.java index 3c23a8859..86bbf5283 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaEntityType.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaEntityType.java @@ -14,13 +14,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** Gets or Sets ScaEntityType */ public enum ScaEntityType { ACCOUNTHOLDER("accountHolder"), + LEGALENTITY("legalEntity"), + PAYMENTINSTRUMENT("paymentInstrument"); + private static final Logger LOG = Logger.getLogger(ScaEntityType.class.getName()); + private String value; ScaEntityType(String value) { @@ -44,6 +49,12 @@ public static ScaEntityType fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "ScaEntityType: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ScaEntityType.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaExemption.java b/src/main/java/com/adyen/model/balanceplatform/ScaExemption.java index a4b37bf72..6ef82e344 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaExemption.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaExemption.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** * The type of exemption for Strong Customer Authentication (SCA). Possible values: * @@ -35,6 +36,8 @@ public enum ScaExemption { ALREADYPERFORMED("alreadyPerformed"); + private static final Logger LOG = Logger.getLogger(ScaExemption.class.getName()); + private String value; ScaExemption(String value) { @@ -58,6 +61,12 @@ public static ScaExemption fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "ScaExemption: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ScaExemption.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaStatus.java b/src/main/java/com/adyen/model/balanceplatform/ScaStatus.java index 89962b11d..3a5e1186c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaStatus.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaStatus.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** * The status of Strong Customer Authentication (SCA). Possible values: * **notPerformed**: the @@ -28,6 +29,8 @@ public enum ScaStatus { PERFORMED("performed"); + private static final Logger LOG = Logger.getLogger(ScaStatus.class.getName()); + private String value; ScaStatus(String value) { @@ -51,6 +54,12 @@ public static ScaStatus fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "ScaStatus: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ScaStatus.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/Scope.java b/src/main/java/com/adyen/model/balanceplatform/Scope.java index 33bc41c94..914305368 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Scope.java +++ b/src/main/java/com/adyen/model/balanceplatform/Scope.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** * The scope to which the transfer limit applies. Possible values: * **perTransaction**: you set a @@ -26,6 +27,8 @@ public enum Scope { PERTRANSACTION("perTransaction"); + private static final Logger LOG = Logger.getLogger(Scope.class.getName()); + private String value; Scope(String value) { @@ -49,6 +52,12 @@ public static Scope fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "Scope: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(Scope.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/SettingType.java b/src/main/java/com/adyen/model/balanceplatform/SettingType.java index 1205ae090..0e0ff6947 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SettingType.java +++ b/src/main/java/com/adyen/model/balanceplatform/SettingType.java @@ -14,11 +14,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** Gets or Sets SettingType */ public enum SettingType { BALANCE("balance"); + private static final Logger LOG = Logger.getLogger(SettingType.class.getName()); + private String value; SettingType(String value) { @@ -42,6 +45,12 @@ public static SettingType fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "SettingType: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(SettingType.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java index 1e134ceef..ab585e6ed 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java @@ -32,6 +32,7 @@ TransactionRule.JSON_PROPERTY_ID, TransactionRule.JSON_PROPERTY_INTERVAL, TransactionRule.JSON_PROPERTY_OUTCOME_TYPE, + TransactionRule.JSON_PROPERTY_PURPOSE, TransactionRule.JSON_PROPERTY_REFERENCE, TransactionRule.JSON_PROPERTY_REQUEST_TYPE, TransactionRule.JSON_PROPERTY_RULE_RESTRICTIONS, @@ -138,6 +139,65 @@ public static OutcomeTypeEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetOutcomeType = false; + /** + * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created + * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the + * transaction adheres to your business' policies. For example, if your business has policies + * about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to + * block transactions that have specific MCCs. + */ + public enum PurposeEnum { + COMPLIANCE(String.valueOf("compliance")), + + FRAUD(String.valueOf("fraud")), + + INTERNALPOLICY(String.valueOf("internalPolicy")), + + POLICY(String.valueOf("policy")), + + SYSTEM(String.valueOf("system")); + + private static final Logger LOG = Logger.getLogger(PurposeEnum.class.getName()); + + private String value; + + PurposeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PurposeEnum fromValue(String value) { + for (PurposeEnum b : PurposeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "PurposeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(PurposeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_PURPOSE = "purpose"; + private PurposeEnum purpose; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurpose = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; @@ -673,6 +733,65 @@ public void setOutcomeType(OutcomeTypeEnum outcomeType) { isSetOutcomeType = true; // mark as set } + /** + * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created + * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the + * transaction adheres to your business' policies. For example, if your business has policies + * about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to + * block transactions that have specific MCCs. + * + * @param purpose Specifies the reason for creating the rule. Possible values: * **fraud**: the + * rule is created to regulate fraudulent activity. * **policy**: the rule is created to + * ensure that the transaction adheres to your business' policies. For example, if your + * business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, + * you can create a rule to block transactions that have specific MCCs. + * @return the current {@code TransactionRule} instance, allowing for method chaining + */ + public TransactionRule purpose(PurposeEnum purpose) { + this.purpose = purpose; + isSetPurpose = true; // mark as set + return this; + } + + /** + * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created + * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the + * transaction adheres to your business' policies. For example, if your business has policies + * about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to + * block transactions that have specific MCCs. + * + * @return purpose Specifies the reason for creating the rule. Possible values: * **fraud**: the + * rule is created to regulate fraudulent activity. * **policy**: the rule is created to + * ensure that the transaction adheres to your business' policies. For example, if your + * business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, + * you can create a rule to block transactions that have specific MCCs. + */ + @JsonProperty(JSON_PROPERTY_PURPOSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PurposeEnum getPurpose() { + return purpose; + } + + /** + * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created + * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the + * transaction adheres to your business' policies. For example, if your business has policies + * about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to + * block transactions that have specific MCCs. + * + * @param purpose Specifies the reason for creating the rule. Possible values: * **fraud**: the + * rule is created to regulate fraudulent activity. * **policy**: the rule is created to + * ensure that the transaction adheres to your business' policies. For example, if your + * business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, + * you can create a rule to block transactions that have specific MCCs. + */ + @JsonProperty(JSON_PROPERTY_PURPOSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPurpose(PurposeEnum purpose) { + this.purpose = purpose; + isSetPurpose = true; // mark as set + } + /** * Your reference for the transaction rule. * @@ -1049,6 +1168,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetInterval, transactionRule.isSetInterval) && Objects.equals(this.outcomeType, transactionRule.outcomeType) && Objects.equals(this.isSetOutcomeType, transactionRule.isSetOutcomeType) + && Objects.equals(this.purpose, transactionRule.purpose) + && Objects.equals(this.isSetPurpose, transactionRule.isSetPurpose) && Objects.equals(this.reference, transactionRule.reference) && Objects.equals(this.isSetReference, transactionRule.isSetReference) && Objects.equals(this.requestType, transactionRule.requestType) @@ -1082,6 +1203,8 @@ public int hashCode() { isSetInterval, outcomeType, isSetOutcomeType, + purpose, + isSetPurpose, reference, isSetReference, requestType, @@ -1109,6 +1232,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); sb.append(" outcomeType: ").append(toIndentedString(outcomeType)).append("\n"); + sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); sb.append(" ruleRestrictions: ").append(toIndentedString(ruleRestrictions)).append("\n"); @@ -1161,6 +1285,9 @@ public Map getExplicitNulls() { if (isSetOutcomeType) { addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); } + if (isSetPurpose) { + addIfNull(nulls, JSON_PROPERTY_PURPOSE, this.purpose); + } if (isSetReference) { addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); } diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java index b77c1e31c..bc9931eb2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java @@ -31,6 +31,7 @@ TransactionRuleInfo.JSON_PROPERTY_ENTITY_KEY, TransactionRuleInfo.JSON_PROPERTY_INTERVAL, TransactionRuleInfo.JSON_PROPERTY_OUTCOME_TYPE, + TransactionRuleInfo.JSON_PROPERTY_PURPOSE, TransactionRuleInfo.JSON_PROPERTY_REFERENCE, TransactionRuleInfo.JSON_PROPERTY_REQUEST_TYPE, TransactionRuleInfo.JSON_PROPERTY_RULE_RESTRICTIONS, @@ -131,6 +132,65 @@ public static OutcomeTypeEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetOutcomeType = false; + /** + * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created + * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the + * transaction adheres to your business' policies. For example, if your business has policies + * about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to + * block transactions that have specific MCCs. + */ + public enum PurposeEnum { + COMPLIANCE(String.valueOf("compliance")), + + FRAUD(String.valueOf("fraud")), + + INTERNALPOLICY(String.valueOf("internalPolicy")), + + POLICY(String.valueOf("policy")), + + SYSTEM(String.valueOf("system")); + + private static final Logger LOG = Logger.getLogger(PurposeEnum.class.getName()); + + private String value; + + PurposeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PurposeEnum fromValue(String value) { + for (PurposeEnum b : PurposeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "PurposeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(PurposeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_PURPOSE = "purpose"; + private PurposeEnum purpose; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurpose = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; @@ -631,6 +691,65 @@ public void setOutcomeType(OutcomeTypeEnum outcomeType) { isSetOutcomeType = true; // mark as set } + /** + * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created + * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the + * transaction adheres to your business' policies. For example, if your business has policies + * about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to + * block transactions that have specific MCCs. + * + * @param purpose Specifies the reason for creating the rule. Possible values: * **fraud**: the + * rule is created to regulate fraudulent activity. * **policy**: the rule is created to + * ensure that the transaction adheres to your business' policies. For example, if your + * business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, + * you can create a rule to block transactions that have specific MCCs. + * @return the current {@code TransactionRuleInfo} instance, allowing for method chaining + */ + public TransactionRuleInfo purpose(PurposeEnum purpose) { + this.purpose = purpose; + isSetPurpose = true; // mark as set + return this; + } + + /** + * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created + * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the + * transaction adheres to your business' policies. For example, if your business has policies + * about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to + * block transactions that have specific MCCs. + * + * @return purpose Specifies the reason for creating the rule. Possible values: * **fraud**: the + * rule is created to regulate fraudulent activity. * **policy**: the rule is created to + * ensure that the transaction adheres to your business' policies. For example, if your + * business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, + * you can create a rule to block transactions that have specific MCCs. + */ + @JsonProperty(JSON_PROPERTY_PURPOSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PurposeEnum getPurpose() { + return purpose; + } + + /** + * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created + * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the + * transaction adheres to your business' policies. For example, if your business has policies + * about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to + * block transactions that have specific MCCs. + * + * @param purpose Specifies the reason for creating the rule. Possible values: * **fraud**: the + * rule is created to regulate fraudulent activity. * **policy**: the rule is created to + * ensure that the transaction adheres to your business' policies. For example, if your + * business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, + * you can create a rule to block transactions that have specific MCCs. + */ + @JsonProperty(JSON_PROPERTY_PURPOSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPurpose(PurposeEnum purpose) { + this.purpose = purpose; + isSetPurpose = true; // mark as set + } + /** * Your reference for the transaction rule. * @@ -1005,6 +1124,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetInterval, transactionRuleInfo.isSetInterval) && Objects.equals(this.outcomeType, transactionRuleInfo.outcomeType) && Objects.equals(this.isSetOutcomeType, transactionRuleInfo.isSetOutcomeType) + && Objects.equals(this.purpose, transactionRuleInfo.purpose) + && Objects.equals(this.isSetPurpose, transactionRuleInfo.isSetPurpose) && Objects.equals(this.reference, transactionRuleInfo.reference) && Objects.equals(this.isSetReference, transactionRuleInfo.isSetReference) && Objects.equals(this.requestType, transactionRuleInfo.requestType) @@ -1036,6 +1157,8 @@ public int hashCode() { isSetInterval, outcomeType, isSetOutcomeType, + purpose, + isSetPurpose, reference, isSetReference, requestType, @@ -1062,6 +1185,7 @@ public String toString() { sb.append(" entityKey: ").append(toIndentedString(entityKey)).append("\n"); sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); sb.append(" outcomeType: ").append(toIndentedString(outcomeType)).append("\n"); + sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); sb.append(" ruleRestrictions: ").append(toIndentedString(ruleRestrictions)).append("\n"); @@ -1111,6 +1235,9 @@ public Map getExplicitNulls() { if (isSetOutcomeType) { addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); } + if (isSetPurpose) { + addIfNull(nulls, JSON_PROPERTY_PURPOSE, this.purpose); + } if (isSetReference) { addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); } diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferType.java b/src/main/java/com/adyen/model/balanceplatform/TransferType.java index 0e8afe2cd..572f4750e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferType.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferType.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.*; +import java.util.logging.Logger; /** * The type of transfer to which the limit applies. Possible values: * **instant**: the limit @@ -25,6 +26,8 @@ public enum TransferType { ALL("all"); + private static final Logger LOG = Logger.getLogger(TransferType.class.getName()); + private String value; TransferType(String value) { @@ -48,6 +51,12 @@ public static TransferType fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + // handling unexpected value + LOG.warning( + "TransferType: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TransferType.values())); + return null; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/UKLocalMandateAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/UKLocalMandateAccountIdentification.java new file mode 100644 index 000000000..7f9633acd --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/UKLocalMandateAccountIdentification.java @@ -0,0 +1,315 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** UKLocalMandateAccountIdentification */ +@JsonPropertyOrder({ + UKLocalMandateAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + UKLocalMandateAccountIdentification.JSON_PROPERTY_SORT_CODE, + UKLocalMandateAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class UKLocalMandateAccountIdentification extends MandateAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; + private String sortCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + + 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 UKLocalMandateAccountIdentification() {} + + /** + * The 8-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 8-digit bank account number, without separators or whitespace. + * @return the current {@code UKLocalMandateAccountIdentification} instance, allowing for method + * chaining + */ + public UKLocalMandateAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 8-digit bank account number, without separators or whitespace. + * + * @return accountNumber The 8-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 8-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 8-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or + * whitespace. + * + * @param sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without + * separators or whitespace. + * @return the current {@code UKLocalMandateAccountIdentification} instance, allowing for method + * chaining + */ + public UKLocalMandateAccountIdentification sortCode(String sortCode) { + this.sortCode = sortCode; + isSetSortCode = true; // mark as set + return this; + } + + /** + * The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or + * whitespace. + * + * @return sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without + * separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_SORT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSortCode() { + return sortCode; + } + + /** + * The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or + * whitespace. + * + * @param sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without + * separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_SORT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortCode(String sortCode) { + this.sortCode = sortCode; + isSetSortCode = true; // mark as set + } + + /** + * **ukLocal** + * + * @param type **ukLocal** + * @return the current {@code UKLocalMandateAccountIdentification} instance, allowing for method + * chaining + */ + public UKLocalMandateAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **ukLocal** + * + * @return type **ukLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **ukLocal** + * + * @param type **ukLocal** + */ + @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 UKLocalMandateAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this UKLocalMandateAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UKLocalMandateAccountIdentification ukLocalMandateAccountIdentification = + (UKLocalMandateAccountIdentification) o; + return Objects.equals(this.accountNumber, ukLocalMandateAccountIdentification.accountNumber) + && Objects.equals( + this.isSetAccountNumber, ukLocalMandateAccountIdentification.isSetAccountNumber) + && Objects.equals(this.sortCode, ukLocalMandateAccountIdentification.sortCode) + && Objects.equals(this.isSetSortCode, ukLocalMandateAccountIdentification.isSetSortCode) + && Objects.equals(this.type, ukLocalMandateAccountIdentification.type) + && Objects.equals(this.isSetType, ukLocalMandateAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + sortCode, + isSetSortCode, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UKLocalMandateAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" sortCode: ").append(toIndentedString(sortCode)).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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("UKLocalMandateAccountIdentification", UKLocalMandateAccountIdentification.class); + JSON.registerDiscriminator(UKLocalMandateAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of UKLocalMandateAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of UKLocalMandateAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * UKLocalMandateAccountIdentification + */ + public static UKLocalMandateAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, UKLocalMandateAccountIdentification.class); + } + + /** + * Convert an instance of UKLocalMandateAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java index 52d40d899..0eb06e4d9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java @@ -46,7 +46,9 @@ public class UpdatePaymentInstrument { public static final String JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS = "additionalBankAccountIdentifications"; - @Deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + + /* deprecated since Configuration API v2: Please use `bankAccount` object instead */ + @Deprecated private List additionalBankAccountIdentifications; @@ -308,9 +310,9 @@ public UpdatePaymentInstrument() {} * details. Returned when you create a payment instrument with `type` * **bankAccount**. * @return the current {@code UpdatePaymentInstrument} instance, allowing for method chaining - * @deprecated since Configuration API v2 Please use `bankAccount` object instead + * @deprecated since Configuration API v2 Please use `bankAccount` object instead */ - @Deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + @Deprecated public UpdatePaymentInstrument additionalBankAccountIdentifications( List additionalBankAccountIdentifications) { @@ -336,9 +338,9 @@ public UpdatePaymentInstrument addAdditionalBankAccountIdentificationsItem( * @return additionalBankAccountIdentifications Contains optional, additional business account * details. Returned when you create a payment instrument with `type` * **bankAccount**. - * @deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + * @deprecated since Configuration API v2 Please use `bankAccount` object instead */ - @Deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + @Deprecated @JsonProperty(JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public List @@ -353,9 +355,9 @@ public UpdatePaymentInstrument addAdditionalBankAccountIdentificationsItem( * @param additionalBankAccountIdentifications Contains optional, additional business account * details. Returned when you create a payment instrument with `type` * **bankAccount**. - * @deprecated since Configuration API v2 Please use `bankAccount` object instead + * @deprecated since Configuration API v2 Please use `bankAccount` object instead */ - @Deprecated // deprecated since Configuration API v2: Please use `bankAccount` object instead + @Deprecated @JsonProperty(JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalBankAccountIdentifications( diff --git a/src/main/java/com/adyen/service/balanceplatform/DirectDebitMandatesApi.java b/src/main/java/com/adyen/service/balanceplatform/DirectDebitMandatesApi.java new file mode 100644 index 000000000..1ae5c9db2 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/DirectDebitMandatesApi.java @@ -0,0 +1,209 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.RequestOptions; +import com.adyen.model.balanceplatform.ListMandatesResponse; +import com.adyen.model.balanceplatform.Mandate; +import com.adyen.model.balanceplatform.MandateUpdate; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class DirectDebitMandatesApi extends Service { + + public static final String API_VERSION = "2"; + + protected String baseURL; + + /** + * Direct debit mandates constructor in {@link com.adyen.service.balanceplatform package}. + * + * @param client {@link Client } (required) + */ + public DirectDebitMandatesApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Direct debit mandates constructor in {@link com.adyen.service.balanceplatform 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 DirectDebitMandatesApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Cancel a mandate + * + * @param mandateId {@link String } The unique identifier of the mandate. (required) + * @throws ApiException if fails to make API call + */ + public void cancelMandate(String mandateId) throws ApiException, IOException { + cancelMandate(mandateId, null); + } + + /** + * Cancel a mandate + * + * @param mandateId {@link String } The unique identifier of the mandate. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void cancelMandate(String mandateId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (mandateId == null) { + throw new IllegalArgumentException("Please provide the mandateId path parameter"); + } + pathParams.put("mandateId", mandateId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/mandates/{mandateId}/cancel", null); + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + } + + /** + * Get a list of mandates + * + * @return {@link ListMandatesResponse } + * @throws ApiException if fails to make API call + */ + public ListMandatesResponse getListOfMandates() throws ApiException, IOException { + return getListOfMandates(null, null, null, null); + } + + /** + * Get a list of mandates + * + * @param balanceAccountId {@link String } Query: The unique identifier of the balance account + * linked to the payment instrument. (optional) + * @param paymentInstrumentId {@link String } Query: The unique identifier of the payment + * instrument linked to the mandate. (optional) + * @param cursor {@link String } Query: The pagination cursor returned in a previous GET + * `/mandates` request. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link ListMandatesResponse } + * @throws ApiException if fails to make API call + */ + public ListMandatesResponse getListOfMandates( + String balanceAccountId, + String paymentInstrumentId, + String cursor, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add query params + Map queryParams = new HashMap<>(); + if (balanceAccountId != null) { + queryParams.put("balanceAccountId", balanceAccountId); + } + if (paymentInstrumentId != null) { + queryParams.put("paymentInstrumentId", paymentInstrumentId); + } + if (cursor != null) { + queryParams.put("cursor", cursor); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/mandates", null); + String jsonResult = + resource.request( + requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return ListMandatesResponse.fromJson(jsonResult); + } + + /** + * Get a specific mandate + * + * @param mandateId {@link String } The unique identifier of the mandate. (required) + * @return {@link Mandate } + * @throws ApiException if fails to make API call + */ + public Mandate getMandateById(String mandateId) throws ApiException, IOException { + return getMandateById(mandateId, null); + } + + /** + * Get a specific mandate + * + * @param mandateId {@link String } The unique identifier of the mandate. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link Mandate } + * @throws ApiException if fails to make API call + */ + public Mandate getMandateById(String mandateId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (mandateId == null) { + throw new IllegalArgumentException("Please provide the mandateId path parameter"); + } + pathParams.put("mandateId", mandateId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/mandates/{mandateId}", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Mandate.fromJson(jsonResult); + } + + /** + * Amend a mandate + * + * @param mandateId {@link String } The unique identifier of the mandate. (required) + * @param mandateUpdate {@link MandateUpdate } (required) + * @throws ApiException if fails to make API call + */ + public void updateMandate(String mandateId, MandateUpdate mandateUpdate) + throws ApiException, IOException { + updateMandate(mandateId, mandateUpdate, null); + } + + /** + * Amend a mandate + * + * @param mandateId {@link String } The unique identifier of the mandate. (required) + * @param mandateUpdate {@link MandateUpdate } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void updateMandate( + String mandateId, MandateUpdate mandateUpdate, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (mandateId == null) { + throw new IllegalArgumentException("Please provide the mandateId path parameter"); + } + pathParams.put("mandateId", mandateId); + + String requestBody = mandateUpdate.toJson(); + Resource resource = new Resource(this, this.baseURL + "/mandates/{mandateId}", null); + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/ScaAssociationManagementApi.java b/src/main/java/com/adyen/service/balanceplatform/ScaAssociationManagementApi.java index 26904f186..92af3bc51 100644 --- a/src/main/java/com/adyen/service/balanceplatform/ScaAssociationManagementApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/ScaAssociationManagementApi.java @@ -90,8 +90,8 @@ public ApproveAssociationResponse approveAssociation( * Get a list of devices associated with an entity * * @param entityType {@link ScaEntityType } Query: The type of entity you want to retrieve a list - * of associations for. Possible values: **accountHolder** or **paymentInstrument**. - * (required) + * of associations for. Possible values: **accountHolder**, **legalEntity** or + * **paymentInstrument**. (required) * @param entityId {@link String } Query: The unique identifier of the entity. (required) * @param pageSize {@link Integer } Query: The number of items to have on a page. Default: **5**. * (required) @@ -110,8 +110,8 @@ public ListAssociationsResponse listAssociations( * Get a list of devices associated with an entity * * @param entityType {@link ScaEntityType } Query: The type of entity you want to retrieve a list - * of associations for. Possible values: **accountHolder** or **paymentInstrument**. - * (required) + * of associations for. Possible values: **accountHolder**, **legalEntity** or + * **paymentInstrument**. (required) * @param entityId {@link String } Query: The unique identifier of the entity. (required) * @param pageSize {@link Integer } Query: The number of items to have on a page. Default: **5**. * (required)