diff --git a/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AbstractOpenApiSchema.java new file mode 100644 index 000000000..92f558eb0 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AbstractOpenApiSchema.java @@ -0,0 +1,142 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.annotation.JsonValue; +import jakarta.ws.rs.core.GenericType; +import java.util.Map; +import java.util.Objects; + +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + /** + * @param schemaType the schema type + * @param isNullable whether the instance is nullable + */ + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + return Boolean.TRUE.equals(isNullable); + } +} diff --git a/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Amount.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Amount.java new file mode 100644 index 000000000..52fb39bfd --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Amount.java @@ -0,0 +1,173 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** Amount */ +@JsonPropertyOrder({Amount.JSON_PROPERTY_CURRENCY, Amount.JSON_PROPERTY_VALUE}) +public class Amount { + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + public Amount() {} + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * @return the current {@code Amount} instance, allowing for method chaining + */ + public Amount currency(String currency) { + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @return currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @param value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * @return the current {@code Amount} instance, allowing for method chaining + */ + public Amount value(Long value) { + this.value = value; + return this; + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @return value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @param value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Long value) { + this.value = value; + } + + /** Return true if this Amount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Amount amount = (Amount) o; + return Objects.equals(this.currency, amount.currency) + && Objects.equals(this.value, amount.value); + } + + @Override + public int hashCode() { + return Objects.hash(currency, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Amount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } + + /** + * Create an instance of Amount given an JSON string + * + * @param jsonString JSON string + * @return An instance of Amount + * @throws JsonProcessingException if the JSON string is invalid with respect to Amount + */ + public static Amount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Amount.class); + } + + /** + * Convert an instance of Amount 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/relayedauthorizationwebhooks/AmountAdjustment.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AmountAdjustment.java new file mode 100644 index 000000000..35fa38ae9 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AmountAdjustment.java @@ -0,0 +1,375 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** AmountAdjustment */ +@JsonPropertyOrder({ + AmountAdjustment.JSON_PROPERTY_AMOUNT, + AmountAdjustment.JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE, + AmountAdjustment.JSON_PROPERTY_BASEPOINTS, + AmountAdjustment.JSON_PROPERTY_FIXED_AMOUNT, + AmountAdjustment.JSON_PROPERTY_FLOOR_AMOUNT, + AmountAdjustment.JSON_PROPERTY_LIMIT_AMOUNT +}) +public class AmountAdjustment { + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** + * The type of markup that is applied to an authorised payment. Possible values: **exchange**, + * **forexMarkup**, **authHoldReserve**, **atmMarkup**. + */ + public enum AmountAdjustmentTypeEnum { + ATMMARKUP(String.valueOf("atmMarkup")), + + AUTHHOLDRESERVE(String.valueOf("authHoldReserve")), + + EXCHANGE(String.valueOf("exchange")), + + FOREXMARKUP(String.valueOf("forexMarkup")); + + private static final Logger LOG = Logger.getLogger(AmountAdjustmentTypeEnum.class.getName()); + + private String value; + + AmountAdjustmentTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AmountAdjustmentTypeEnum fromValue(String value) { + for (AmountAdjustmentTypeEnum b : AmountAdjustmentTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "AmountAdjustmentTypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(AmountAdjustmentTypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE = "amountAdjustmentType"; + private AmountAdjustmentTypeEnum amountAdjustmentType; + + public static final String JSON_PROPERTY_BASEPOINTS = "basepoints"; + private Integer basepoints; + + public static final String JSON_PROPERTY_FIXED_AMOUNT = "fixedAmount"; + private Amount fixedAmount; + + public static final String JSON_PROPERTY_FLOOR_AMOUNT = "floorAmount"; + private Amount floorAmount; + + public static final String JSON_PROPERTY_LIMIT_AMOUNT = "limitAmount"; + private Amount limitAmount; + + public AmountAdjustment() {} + + /** + * amount + * + * @param amount + * @return the current {@code AmountAdjustment} instance, allowing for method chaining + */ + public AmountAdjustment amount(Amount amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + } + + /** + * The type of markup that is applied to an authorised payment. Possible values: **exchange**, + * **forexMarkup**, **authHoldReserve**, **atmMarkup**. + * + * @param amountAdjustmentType The type of markup that is applied to an authorised payment. + * Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**. + * @return the current {@code AmountAdjustment} instance, allowing for method chaining + */ + public AmountAdjustment amountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { + this.amountAdjustmentType = amountAdjustmentType; + return this; + } + + /** + * The type of markup that is applied to an authorised payment. Possible values: **exchange**, + * **forexMarkup**, **authHoldReserve**, **atmMarkup**. + * + * @return amountAdjustmentType The type of markup that is applied to an authorised payment. + * Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**. + */ + @JsonProperty(JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AmountAdjustmentTypeEnum getAmountAdjustmentType() { + return amountAdjustmentType; + } + + /** + * The type of markup that is applied to an authorised payment. Possible values: **exchange**, + * **forexMarkup**, **authHoldReserve**, **atmMarkup**. + * + * @param amountAdjustmentType The type of markup that is applied to an authorised payment. + * Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**. + */ + @JsonProperty(JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { + this.amountAdjustmentType = amountAdjustmentType; + } + + /** + * The basepoints associated with the applied markup. + * + * @param basepoints The basepoints associated with the applied markup. + * @return the current {@code AmountAdjustment} instance, allowing for method chaining + */ + public AmountAdjustment basepoints(Integer basepoints) { + this.basepoints = basepoints; + return this; + } + + /** + * The basepoints associated with the applied markup. + * + * @return basepoints The basepoints associated with the applied markup. + */ + @JsonProperty(JSON_PROPERTY_BASEPOINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBasepoints() { + return basepoints; + } + + /** + * The basepoints associated with the applied markup. + * + * @param basepoints The basepoints associated with the applied markup. + */ + @JsonProperty(JSON_PROPERTY_BASEPOINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBasepoints(Integer basepoints) { + this.basepoints = basepoints; + } + + /** + * fixedAmount + * + * @param fixedAmount + * @return the current {@code AmountAdjustment} instance, allowing for method chaining + */ + public AmountAdjustment fixedAmount(Amount fixedAmount) { + this.fixedAmount = fixedAmount; + return this; + } + + /** + * Get fixedAmount + * + * @return fixedAmount + */ + @JsonProperty(JSON_PROPERTY_FIXED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getFixedAmount() { + return fixedAmount; + } + + /** + * fixedAmount + * + * @param fixedAmount + */ + @JsonProperty(JSON_PROPERTY_FIXED_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFixedAmount(Amount fixedAmount) { + this.fixedAmount = fixedAmount; + } + + /** + * floorAmount + * + * @param floorAmount + * @return the current {@code AmountAdjustment} instance, allowing for method chaining + */ + public AmountAdjustment floorAmount(Amount floorAmount) { + this.floorAmount = floorAmount; + return this; + } + + /** + * Get floorAmount + * + * @return floorAmount + */ + @JsonProperty(JSON_PROPERTY_FLOOR_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getFloorAmount() { + return floorAmount; + } + + /** + * floorAmount + * + * @param floorAmount + */ + @JsonProperty(JSON_PROPERTY_FLOOR_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloorAmount(Amount floorAmount) { + this.floorAmount = floorAmount; + } + + /** + * limitAmount + * + * @param limitAmount + * @return the current {@code AmountAdjustment} instance, allowing for method chaining + */ + public AmountAdjustment limitAmount(Amount limitAmount) { + this.limitAmount = limitAmount; + return this; + } + + /** + * Get limitAmount + * + * @return limitAmount + */ + @JsonProperty(JSON_PROPERTY_LIMIT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getLimitAmount() { + return limitAmount; + } + + /** + * limitAmount + * + * @param limitAmount + */ + @JsonProperty(JSON_PROPERTY_LIMIT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimitAmount(Amount limitAmount) { + this.limitAmount = limitAmount; + } + + /** Return true if this AmountAdjustment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AmountAdjustment amountAdjustment = (AmountAdjustment) o; + return Objects.equals(this.amount, amountAdjustment.amount) + && Objects.equals(this.amountAdjustmentType, amountAdjustment.amountAdjustmentType) + && Objects.equals(this.basepoints, amountAdjustment.basepoints) + && Objects.equals(this.fixedAmount, amountAdjustment.fixedAmount) + && Objects.equals(this.floorAmount, amountAdjustment.floorAmount) + && Objects.equals(this.limitAmount, amountAdjustment.limitAmount); + } + + @Override + public int hashCode() { + return Objects.hash( + amount, amountAdjustmentType, basepoints, fixedAmount, floorAmount, limitAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AmountAdjustment {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" amountAdjustmentType: ") + .append(toIndentedString(amountAdjustmentType)) + .append("\n"); + sb.append(" basepoints: ").append(toIndentedString(basepoints)).append("\n"); + sb.append(" fixedAmount: ").append(toIndentedString(fixedAmount)).append("\n"); + sb.append(" floorAmount: ").append(toIndentedString(floorAmount)).append("\n"); + sb.append(" limitAmount: ").append(toIndentedString(limitAmount)).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 "); + } + + /** + * Create an instance of AmountAdjustment given an JSON string + * + * @param jsonString JSON string + * @return An instance of AmountAdjustment + * @throws JsonProcessingException if the JSON string is invalid with respect to AmountAdjustment + */ + public static AmountAdjustment fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AmountAdjustment.class); + } + + /** + * Convert an instance of AmountAdjustment 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/relayedauthorizationwebhooks/Authentication.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Authentication.java new file mode 100644 index 000000000..551f6b4cd --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Authentication.java @@ -0,0 +1,215 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** Authentication */ +@JsonPropertyOrder({ + Authentication.JSON_PROPERTY_EMAIL, + Authentication.JSON_PROPERTY_PASSWORD, + Authentication.JSON_PROPERTY_PHONE +}) +public class Authentication { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private Phone phone; + + public Authentication() {} + + /** + * The email address where the one-time password (OTP) is sent. + * + * @param email The email address where the one-time password (OTP) is sent. + * @return the current {@code Authentication} instance, allowing for method chaining + */ + public Authentication email(String email) { + this.email = email; + return this; + } + + /** + * The email address where the one-time password (OTP) is sent. + * + * @return email The email address where the one-time password (OTP) is sent. + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + /** + * The email address where the one-time password (OTP) is sent. + * + * @param email The email address where the one-time password (OTP) is sent. + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + /** + * The password used for 3D Secure password-based authentication. The value must be between 1 to + * 30 characters and must only contain the following supported characters. * Characters between + * **a-z**, **A-Z**, and **0-9** * Special characters: + * **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + * + * @param password The password used for 3D Secure password-based authentication. The value must + * be between 1 to 30 characters and must only contain the following supported characters. * + * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: + * **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + * @return the current {@code Authentication} instance, allowing for method chaining + */ + public Authentication password(String password) { + this.password = password; + return this; + } + + /** + * The password used for 3D Secure password-based authentication. The value must be between 1 to + * 30 characters and must only contain the following supported characters. * Characters between + * **a-z**, **A-Z**, and **0-9** * Special characters: + * **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + * + * @return password The password used for 3D Secure password-based authentication. The value must + * be between 1 to 30 characters and must only contain the following supported characters. * + * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: + * **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + */ + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + /** + * The password used for 3D Secure password-based authentication. The value must be between 1 to + * 30 characters and must only contain the following supported characters. * Characters between + * **a-z**, **A-Z**, and **0-9** * Special characters: + * **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + * + * @param password The password used for 3D Secure password-based authentication. The value must + * be between 1 to 30 characters and must only contain the following supported characters. * + * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: + * **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + */ + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + /** + * phone + * + * @param phone + * @return the current {@code Authentication} instance, allowing for method chaining + */ + public Authentication phone(Phone phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * + * @return phone + */ + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Phone getPhone() { + return phone; + } + + /** + * phone + * + * @param phone + */ + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(Phone phone) { + this.phone = phone; + } + + /** Return true if this Authentication object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Authentication authentication = (Authentication) o; + return Objects.equals(this.email, authentication.email) + && Objects.equals(this.password, authentication.password) + && Objects.equals(this.phone, authentication.phone); + } + + @Override + public int hashCode() { + return Objects.hash(email, password, phone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Authentication {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).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 "); + } + + /** + * Create an instance of Authentication given an JSON string + * + * @param jsonString JSON string + * @return An instance of Authentication + * @throws JsonProcessingException if the JSON string is invalid with respect to Authentication + */ + public static Authentication fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Authentication.class); + } + + /** + * Convert an instance of Authentication 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/relayedauthorizationwebhooks/AuthorisationDecisionRequest.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AuthorisationDecisionRequest.java new file mode 100644 index 000000000..b57a4ccda --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AuthorisationDecisionRequest.java @@ -0,0 +1,202 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** AuthorisationDecisionRequest */ +@JsonPropertyOrder({ + AuthorisationDecisionRequest.JSON_PROPERTY_REASON_CODE, + AuthorisationDecisionRequest.JSON_PROPERTY_STATUS, + AuthorisationDecisionRequest.JSON_PROPERTY_STATUS_CODE +}) +public class AuthorisationDecisionRequest { + public static final String JSON_PROPERTY_REASON_CODE = "reasonCode"; + private String reasonCode; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_STATUS_CODE = "statusCode"; + private String statusCode; + + public AuthorisationDecisionRequest() {} + + /** + * The reason of the authorization decision. + * + * @param reasonCode The reason of the authorization decision. + * @return the current {@code AuthorisationDecisionRequest} instance, allowing for method chaining + */ + public AuthorisationDecisionRequest reasonCode(String reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * The reason of the authorization decision. + * + * @return reasonCode The reason of the authorization decision. + */ + @JsonProperty(JSON_PROPERTY_REASON_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReasonCode() { + return reasonCode; + } + + /** + * The reason of the authorization decision. + * + * @param reasonCode The reason of the authorization decision. + */ + @JsonProperty(JSON_PROPERTY_REASON_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReasonCode(String reasonCode) { + this.reasonCode = reasonCode; + } + + /** + * The status of the authorization decision. Possible values: **Authorised** or **Refused**. + * + * @param status The status of the authorization decision. Possible values: **Authorised** or + * **Refused**. + * @return the current {@code AuthorisationDecisionRequest} instance, allowing for method chaining + */ + public AuthorisationDecisionRequest status(String status) { + this.status = status; + return this; + } + + /** + * The status of the authorization decision. Possible values: **Authorised** or **Refused**. + * + * @return status The status of the authorization decision. Possible values: **Authorised** or + * **Refused**. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + /** + * The status of the authorization decision. Possible values: **Authorised** or **Refused**. + * + * @param status The status of the authorization decision. Possible values: **Authorised** or + * **Refused**. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(String status) { + this.status = status; + } + + /** + * The code of the authorization decision. + * + * @param statusCode The code of the authorization decision. + * @return the current {@code AuthorisationDecisionRequest} instance, allowing for method chaining + */ + public AuthorisationDecisionRequest statusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * The code of the authorization decision. + * + * @return statusCode The code of the authorization decision. + */ + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatusCode() { + return statusCode; + } + + /** + * The code of the authorization decision. + * + * @param statusCode The code of the authorization decision. + */ + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + /** Return true if this AuthorisationDecisionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorisationDecisionRequest authorisationDecisionRequest = (AuthorisationDecisionRequest) o; + return Objects.equals(this.reasonCode, authorisationDecisionRequest.reasonCode) + && Objects.equals(this.status, authorisationDecisionRequest.status) + && Objects.equals(this.statusCode, authorisationDecisionRequest.statusCode); + } + + @Override + public int hashCode() { + return Objects.hash(reasonCode, status, statusCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorisationDecisionRequest {\n"); + sb.append(" reasonCode: ").append(toIndentedString(reasonCode)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).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 "); + } + + /** + * Create an instance of AuthorisationDecisionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthorisationDecisionRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * AuthorisationDecisionRequest + */ + public static AuthorisationDecisionRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AuthorisationDecisionRequest.class); + } + + /** + * Convert an instance of AuthorisationDecisionRequest 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/relayedauthorizationwebhooks/AuthorisationDecisionResponse.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AuthorisationDecisionResponse.java new file mode 100644 index 000000000..3a4f01b30 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/AuthorisationDecisionResponse.java @@ -0,0 +1,223 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** AuthorisationDecisionResponse */ +@JsonPropertyOrder({ + AuthorisationDecisionResponse.JSON_PROPERTY_REFUSAL_REASON, + AuthorisationDecisionResponse.JSON_PROPERTY_STATUS +}) +public class AuthorisationDecisionResponse { + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; + private String refusalReason; + + /** + * The status of the authorization. Possible values: * **Authorised** * **Refused** For more + * information, refer to [Use relayed + * authorization](https://docs.adyen.com/issuing/authorisation/relayed-authorisation/). + */ + public enum StatusEnum { + AUTHORISED(String.valueOf("Authorised")), + + REFUSED(String.valueOf("Refused")); + + private static final Logger LOG = Logger.getLogger(StatusEnum.class.getName()); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "StatusEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(StatusEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public AuthorisationDecisionResponse() {} + + /** + * The reason for refusing the authorization. + * + * @param refusalReason The reason for refusing the authorization. + * @return the current {@code AuthorisationDecisionResponse} instance, allowing for method + * chaining + */ + public AuthorisationDecisionResponse refusalReason(String refusalReason) { + this.refusalReason = refusalReason; + return this; + } + + /** + * The reason for refusing the authorization. + * + * @return refusalReason The reason for refusing the authorization. + */ + @JsonProperty(JSON_PROPERTY_REFUSAL_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRefusalReason() { + return refusalReason; + } + + /** + * The reason for refusing the authorization. + * + * @param refusalReason The reason for refusing the authorization. + */ + @JsonProperty(JSON_PROPERTY_REFUSAL_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefusalReason(String refusalReason) { + this.refusalReason = refusalReason; + } + + /** + * The status of the authorization. Possible values: * **Authorised** * **Refused** For more + * information, refer to [Use relayed + * authorization](https://docs.adyen.com/issuing/authorisation/relayed-authorisation/). + * + * @param status The status of the authorization. Possible values: * **Authorised** * **Refused** + * For more information, refer to [Use relayed + * authorization](https://docs.adyen.com/issuing/authorisation/relayed-authorisation/). + * @return the current {@code AuthorisationDecisionResponse} instance, allowing for method + * chaining + */ + public AuthorisationDecisionResponse status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the authorization. Possible values: * **Authorised** * **Refused** For more + * information, refer to [Use relayed + * authorization](https://docs.adyen.com/issuing/authorisation/relayed-authorisation/). + * + * @return status The status of the authorization. Possible values: * **Authorised** * **Refused** + * For more information, refer to [Use relayed + * authorization](https://docs.adyen.com/issuing/authorisation/relayed-authorisation/). + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + /** + * The status of the authorization. Possible values: * **Authorised** * **Refused** For more + * information, refer to [Use relayed + * authorization](https://docs.adyen.com/issuing/authorisation/relayed-authorisation/). + * + * @param status The status of the authorization. Possible values: * **Authorised** * **Refused** + * For more information, refer to [Use relayed + * authorization](https://docs.adyen.com/issuing/authorisation/relayed-authorisation/). + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** Return true if this AuthorisationDecisionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorisationDecisionResponse authorisationDecisionResponse = (AuthorisationDecisionResponse) o; + return Objects.equals(this.refusalReason, authorisationDecisionResponse.refusalReason) + && Objects.equals(this.status, authorisationDecisionResponse.status); + } + + @Override + public int hashCode() { + return Objects.hash(refusalReason, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorisationDecisionResponse {\n"); + sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } + + /** + * Create an instance of AuthorisationDecisionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthorisationDecisionResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * AuthorisationDecisionResponse + */ + public static AuthorisationDecisionResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AuthorisationDecisionResponse.class); + } + + /** + * Convert an instance of AuthorisationDecisionResponse 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/relayedauthorizationwebhooks/BalanceMutation.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/BalanceMutation.java new file mode 100644 index 000000000..20bd9b652 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/BalanceMutation.java @@ -0,0 +1,281 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** BalanceMutation */ +@JsonPropertyOrder({ + BalanceMutation.JSON_PROPERTY_BALANCE_AFTER, + BalanceMutation.JSON_PROPERTY_BALANCE_BEFORE, + BalanceMutation.JSON_PROPERTY_CURRENCY, + BalanceMutation.JSON_PROPERTY_MUTATION_AMOUNT, + BalanceMutation.JSON_PROPERTY_TYPE +}) +public class BalanceMutation { + public static final String JSON_PROPERTY_BALANCE_AFTER = "balanceAfter"; + private Amount balanceAfter; + + public static final String JSON_PROPERTY_BALANCE_BEFORE = "balanceBefore"; + private Amount balanceBefore; + + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + public static final String JSON_PROPERTY_MUTATION_AMOUNT = "mutationAmount"; + private Amount mutationAmount; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public BalanceMutation() {} + + /** + * balanceAfter + * + * @param balanceAfter + * @return the current {@code BalanceMutation} instance, allowing for method chaining + */ + public BalanceMutation balanceAfter(Amount balanceAfter) { + this.balanceAfter = balanceAfter; + return this; + } + + /** + * Get balanceAfter + * + * @return balanceAfter + */ + @JsonProperty(JSON_PROPERTY_BALANCE_AFTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getBalanceAfter() { + return balanceAfter; + } + + /** + * balanceAfter + * + * @param balanceAfter + */ + @JsonProperty(JSON_PROPERTY_BALANCE_AFTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAfter(Amount balanceAfter) { + this.balanceAfter = balanceAfter; + } + + /** + * balanceBefore + * + * @param balanceBefore + * @return the current {@code BalanceMutation} instance, allowing for method chaining + */ + public BalanceMutation balanceBefore(Amount balanceBefore) { + this.balanceBefore = balanceBefore; + return this; + } + + /** + * Get balanceBefore + * + * @return balanceBefore + */ + @JsonProperty(JSON_PROPERTY_BALANCE_BEFORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getBalanceBefore() { + return balanceBefore; + } + + /** + * balanceBefore + * + * @param balanceBefore + */ + @JsonProperty(JSON_PROPERTY_BALANCE_BEFORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceBefore(Amount balanceBefore) { + this.balanceBefore = balanceBefore; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * @return the current {@code BalanceMutation} instance, allowing for method chaining + */ + public BalanceMutation currency(String currency) { + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * mutationAmount + * + * @param mutationAmount + * @return the current {@code BalanceMutation} instance, allowing for method chaining + */ + public BalanceMutation mutationAmount(Amount mutationAmount) { + this.mutationAmount = mutationAmount; + return this; + } + + /** + * Get mutationAmount + * + * @return mutationAmount + */ + @JsonProperty(JSON_PROPERTY_MUTATION_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getMutationAmount() { + return mutationAmount; + } + + /** + * mutationAmount + * + * @param mutationAmount + */ + @JsonProperty(JSON_PROPERTY_MUTATION_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMutationAmount(Amount mutationAmount) { + this.mutationAmount = mutationAmount; + } + + /** + * The type of the mutation. + * + * @param type The type of the mutation. + * @return the current {@code BalanceMutation} instance, allowing for method chaining + */ + public BalanceMutation type(String type) { + this.type = type; + return this; + } + + /** + * The type of the mutation. + * + * @return type The type of the mutation. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * The type of the mutation. + * + * @param type The type of the mutation. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this BalanceMutation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceMutation balanceMutation = (BalanceMutation) o; + return Objects.equals(this.balanceAfter, balanceMutation.balanceAfter) + && Objects.equals(this.balanceBefore, balanceMutation.balanceBefore) + && Objects.equals(this.currency, balanceMutation.currency) + && Objects.equals(this.mutationAmount, balanceMutation.mutationAmount) + && Objects.equals(this.type, balanceMutation.type); + } + + @Override + public int hashCode() { + return Objects.hash(balanceAfter, balanceBefore, currency, mutationAmount, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceMutation {\n"); + sb.append(" balanceAfter: ").append(toIndentedString(balanceAfter)).append("\n"); + sb.append(" balanceBefore: ").append(toIndentedString(balanceBefore)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" mutationAmount: ").append(toIndentedString(mutationAmount)).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 "); + } + + /** + * Create an instance of BalanceMutation given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceMutation + * @throws JsonProcessingException if the JSON string is invalid with respect to BalanceMutation + */ + public static BalanceMutation fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, BalanceMutation.class); + } + + /** + * Convert an instance of BalanceMutation 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/relayedauthorizationwebhooks/BankAccountDetails.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/BankAccountDetails.java new file mode 100644 index 000000000..8f21ebd60 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/BankAccountDetails.java @@ -0,0 +1,445 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** BankAccountDetails */ +@JsonPropertyOrder({ + BankAccountDetails.JSON_PROPERTY_ACCOUNT_NUMBER, + BankAccountDetails.JSON_PROPERTY_ACCOUNT_TYPE, + BankAccountDetails.JSON_PROPERTY_BRANCH_NUMBER, + BankAccountDetails.JSON_PROPERTY_FORM_FACTOR, + BankAccountDetails.JSON_PROPERTY_IBAN, + BankAccountDetails.JSON_PROPERTY_ROUTING_NUMBER, + BankAccountDetails.JSON_PROPERTY_SORT_CODE, + BankAccountDetails.JSON_PROPERTY_TYPE +}) +public class BankAccountDetails { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; + private String accountType; + + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; + private String branchNumber; + + public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; + private String formFactor; + + public static final String JSON_PROPERTY_IBAN = "iban"; + private String iban; + + public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber"; + private String routingNumber; + + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; + private String sortCode; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public BankAccountDetails() {} + + /** + * The bank account number, without separators or whitespace. + * + * @param accountNumber The bank account number, without separators or whitespace. + * @return the current {@code BankAccountDetails} instance, allowing for method chaining + */ + public BankAccountDetails accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number, without separators or whitespace. + * + * @return accountNumber The bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The bank account number, without separators or whitespace. + * + * @param accountNumber The 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; + } + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @param accountType The bank account type. Possible values: **checking** or **savings**. + * Defaults to **checking**. + * @return the current {@code BankAccountDetails} instance, allowing for method chaining + */ + public BankAccountDetails accountType(String accountType) { + this.accountType = accountType; + return this; + } + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return accountType The bank account type. Possible values: **checking** or **savings**. + * Defaults to **checking**. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountType() { + return accountType; + } + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @param accountType The bank account type. Possible values: **checking** or **savings**. + * Defaults to **checking**. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountType(String accountType) { + this.accountType = accountType; + } + + /** + * The bank account branch number, without separators or whitespace + * + * @param branchNumber The bank account branch number, without separators or whitespace + * @return the current {@code BankAccountDetails} instance, allowing for method chaining + */ + public BankAccountDetails branchNumber(String branchNumber) { + this.branchNumber = branchNumber; + return this; + } + + /** + * The bank account branch number, without separators or whitespace + * + * @return branchNumber The bank account branch number, without separators or whitespace + */ + @JsonProperty(JSON_PROPERTY_BRANCH_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBranchNumber() { + return branchNumber; + } + + /** + * The bank account branch number, without separators or whitespace + * + * @param branchNumber The bank account branch number, without separators or whitespace + */ + @JsonProperty(JSON_PROPERTY_BRANCH_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBranchNumber(String branchNumber) { + this.branchNumber = branchNumber; + } + + /** + * Business accounts with a `formFactor` value of **physical** are business accounts + * issued under the central bank of that country. The default value is **physical** for NL, US, + * and UK business accounts. Adyen creates a local IBAN for business accounts when the + * `formFactor` value is set to **virtual**. The local IBANs that are supported are for + * DE and FR, which reference a physical NL account, with funds being routed through the central + * bank of NL. + * + * @param formFactor Business accounts with a `formFactor` value of **physical** are + * business accounts issued under the central bank of that country. The default value is + * **physical** for NL, US, and UK business accounts. Adyen creates a local IBAN for business + * accounts when the `formFactor` value is set to **virtual**. The local IBANs that + * are supported are for DE and FR, which reference a physical NL account, with funds being + * routed through the central bank of NL. + * @return the current {@code BankAccountDetails} instance, allowing for method chaining + */ + public BankAccountDetails formFactor(String formFactor) { + this.formFactor = formFactor; + return this; + } + + /** + * Business accounts with a `formFactor` value of **physical** are business accounts + * issued under the central bank of that country. The default value is **physical** for NL, US, + * and UK business accounts. Adyen creates a local IBAN for business accounts when the + * `formFactor` value is set to **virtual**. The local IBANs that are supported are for + * DE and FR, which reference a physical NL account, with funds being routed through the central + * bank of NL. + * + * @return formFactor Business accounts with a `formFactor` value of **physical** are + * business accounts issued under the central bank of that country. The default value is + * **physical** for NL, US, and UK business accounts. Adyen creates a local IBAN for business + * accounts when the `formFactor` value is set to **virtual**. The local IBANs that + * are supported are for DE and FR, which reference a physical NL account, with funds being + * routed through the central bank of NL. + */ + @JsonProperty(JSON_PROPERTY_FORM_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFormFactor() { + return formFactor; + } + + /** + * Business accounts with a `formFactor` value of **physical** are business accounts + * issued under the central bank of that country. The default value is **physical** for NL, US, + * and UK business accounts. Adyen creates a local IBAN for business accounts when the + * `formFactor` value is set to **virtual**. The local IBANs that are supported are for + * DE and FR, which reference a physical NL account, with funds being routed through the central + * bank of NL. + * + * @param formFactor Business accounts with a `formFactor` value of **physical** are + * business accounts issued under the central bank of that country. The default value is + * **physical** for NL, US, and UK business accounts. Adyen creates a local IBAN for business + * accounts when the `formFactor` value is set to **virtual**. The local IBANs that + * are supported are for DE and FR, which reference a physical NL account, with funds being + * routed through the central bank of NL. + */ + @JsonProperty(JSON_PROPERTY_FORM_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFactor(String formFactor) { + this.formFactor = formFactor; + } + + /** + * The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @param iban The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * @return the current {@code BankAccountDetails} instance, allowing for method chaining + */ + public BankAccountDetails iban(String iban) { + this.iban = iban; + return this; + } + + /** + * The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return iban The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + */ + @JsonProperty(JSON_PROPERTY_IBAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIban() { + return iban; + } + + /** + * The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @param iban The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + */ + @JsonProperty(JSON_PROPERTY_IBAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIban(String iban) { + this.iban = iban; + } + + /** + * The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without + * separators or whitespace. + * + * @param routingNumber The [routing + * number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or + * whitespace. + * @return the current {@code BankAccountDetails} instance, allowing for method chaining + */ + public BankAccountDetails routingNumber(String routingNumber) { + this.routingNumber = routingNumber; + return this; + } + + /** + * The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without + * separators or whitespace. + * + * @return routingNumber The [routing + * number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or + * whitespace. + */ + @JsonProperty(JSON_PROPERTY_ROUTING_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRoutingNumber() { + return routingNumber; + } + + /** + * The [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without + * separators or whitespace. + * + * @param routingNumber The [routing + * number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or + * whitespace. + */ + @JsonProperty(JSON_PROPERTY_ROUTING_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoutingNumber(String routingNumber) { + this.routingNumber = routingNumber; + } + + /** + * The [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @param sortCode The [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or + * whitespace. + * @return the current {@code BankAccountDetails} instance, allowing for method chaining + */ + public BankAccountDetails sortCode(String sortCode) { + this.sortCode = sortCode; + return this; + } + + /** + * The [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return sortCode The [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 [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @param sortCode The [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; + } + + /** + * **iban** or **usLocal** or **ukLocal** + * + * @param type **iban** or **usLocal** or **ukLocal** + * @return the current {@code BankAccountDetails} instance, allowing for method chaining + */ + public BankAccountDetails type(String type) { + this.type = type; + return this; + } + + /** + * **iban** or **usLocal** or **ukLocal** + * + * @return type **iban** or **usLocal** or **ukLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **iban** or **usLocal** or **ukLocal** + * + * @param type **iban** or **usLocal** or **ukLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this BankAccountDetails object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankAccountDetails bankAccountDetails = (BankAccountDetails) o; + return Objects.equals(this.accountNumber, bankAccountDetails.accountNumber) + && Objects.equals(this.accountType, bankAccountDetails.accountType) + && Objects.equals(this.branchNumber, bankAccountDetails.branchNumber) + && Objects.equals(this.formFactor, bankAccountDetails.formFactor) + && Objects.equals(this.iban, bankAccountDetails.iban) + && Objects.equals(this.routingNumber, bankAccountDetails.routingNumber) + && Objects.equals(this.sortCode, bankAccountDetails.sortCode) + && Objects.equals(this.type, bankAccountDetails.type); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, accountType, branchNumber, formFactor, iban, routingNumber, sortCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BankAccountDetails {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" branchNumber: ").append(toIndentedString(branchNumber)).append("\n"); + sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); + sb.append(" iban: ").append(toIndentedString(iban)).append("\n"); + sb.append(" routingNumber: ").append(toIndentedString(routingNumber)).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 "); + } + + /** + * Create an instance of BankAccountDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of BankAccountDetails + * @throws JsonProcessingException if the JSON string is invalid with respect to + * BankAccountDetails + */ + public static BankAccountDetails fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, BankAccountDetails.class); + } + + /** + * Convert an instance of BankAccountDetails 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/relayedauthorizationwebhooks/BulkAddress.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/BulkAddress.java new file mode 100644 index 000000000..cc77c26bc --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/BulkAddress.java @@ -0,0 +1,621 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** BulkAddress */ +@JsonPropertyOrder({ + BulkAddress.JSON_PROPERTY_CITY, + BulkAddress.JSON_PROPERTY_COMPANY, + BulkAddress.JSON_PROPERTY_COUNTRY, + BulkAddress.JSON_PROPERTY_EMAIL, + BulkAddress.JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, + BulkAddress.JSON_PROPERTY_LINE1, + BulkAddress.JSON_PROPERTY_LINE2, + BulkAddress.JSON_PROPERTY_LINE3, + BulkAddress.JSON_PROPERTY_MOBILE, + BulkAddress.JSON_PROPERTY_NAME, + BulkAddress.JSON_PROPERTY_POSTAL_CODE, + BulkAddress.JSON_PROPERTY_STATE_OR_PROVINCE, + BulkAddress.JSON_PROPERTY_STREET +}) +public class BulkAddress { + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_COMPANY = "company"; + private String company; + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private String country; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; + private String houseNumberOrName; + + public static final String JSON_PROPERTY_LINE1 = "line1"; + private String line1; + + public static final String JSON_PROPERTY_LINE2 = "line2"; + private String line2; + + public static final String JSON_PROPERTY_LINE3 = "line3"; + private String line3; + + public static final String JSON_PROPERTY_MOBILE = "mobile"; + private String mobile; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; + private String postalCode; + + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; + private String stateOrProvince; + + public static final String JSON_PROPERTY_STREET = "street"; + private String street; + + public BulkAddress() {} + + /** + * The name of the city. + * + * @param city The name of the city. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress city(String city) { + this.city = city; + return this; + } + + /** + * The name of the city. + * + * @return city The name of the city. + */ + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCity() { + return city; + } + + /** + * The name of the city. + * + * @param city The name of the city. + */ + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(String city) { + this.city = city; + } + + /** + * The name of the company. + * + * @param company The name of the company. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress company(String company) { + this.company = company; + return this; + } + + /** + * The name of the company. + * + * @return company The name of the company. + */ + @JsonProperty(JSON_PROPERTY_COMPANY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCompany() { + return company; + } + + /** + * The name of the company. + * + * @param company The name of the company. + */ + @JsonProperty(JSON_PROPERTY_COMPANY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompany(String company) { + this.company = company; + } + + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + * + * @param country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress country(String country) { + this.country = country; + return this; + } + + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + * + * @return country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountry() { + return country; + } + + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + * + * @param country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountry(String country) { + this.country = country; + } + + /** + * The email address. + * + * @param email The email address. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress email(String email) { + this.email = email; + return this; + } + + /** + * The email address. + * + * @return email The email address. + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + /** + * The email address. + * + * @param email The email address. + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + /** + * The house number or name. + * + * @param houseNumberOrName The house number or name. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress houseNumberOrName(String houseNumberOrName) { + this.houseNumberOrName = houseNumberOrName; + return this; + } + + /** + * The house number or name. + * + * @return houseNumberOrName The house number or name. + */ + @JsonProperty(JSON_PROPERTY_HOUSE_NUMBER_OR_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHouseNumberOrName() { + return houseNumberOrName; + } + + /** + * The house number or name. + * + * @param houseNumberOrName The house number or name. + */ + @JsonProperty(JSON_PROPERTY_HOUSE_NUMBER_OR_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHouseNumberOrName(String houseNumberOrName) { + this.houseNumberOrName = houseNumberOrName; + } + + /** + * The name of the street and the number of the building. For example: **Simon Carmiggeltstraat + * 6-50**. + * + * @param line1 The name of the street and the number of the building. For example: **Simon + * Carmiggeltstraat 6-50**. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress line1(String line1) { + this.line1 = line1; + return this; + } + + /** + * The name of the street and the number of the building. For example: **Simon Carmiggeltstraat + * 6-50**. + * + * @return line1 The name of the street and the number of the building. For example: **Simon + * Carmiggeltstraat 6-50**. + */ + @JsonProperty(JSON_PROPERTY_LINE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLine1() { + return line1; + } + + /** + * The name of the street and the number of the building. For example: **Simon Carmiggeltstraat + * 6-50**. + * + * @param line1 The name of the street and the number of the building. For example: **Simon + * Carmiggeltstraat 6-50**. + */ + @JsonProperty(JSON_PROPERTY_LINE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLine1(String line1) { + this.line1 = line1; + } + + /** + * Additional information about the delivery address. For example, an apartment number. + * + * @param line2 Additional information about the delivery address. For example, an apartment + * number. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress line2(String line2) { + this.line2 = line2; + return this; + } + + /** + * Additional information about the delivery address. For example, an apartment number. + * + * @return line2 Additional information about the delivery address. For example, an apartment + * number. + */ + @JsonProperty(JSON_PROPERTY_LINE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLine2() { + return line2; + } + + /** + * Additional information about the delivery address. For example, an apartment number. + * + * @param line2 Additional information about the delivery address. For example, an apartment + * number. + */ + @JsonProperty(JSON_PROPERTY_LINE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLine2(String line2) { + this.line2 = line2; + } + + /** + * Additional information about the delivery address. + * + * @param line3 Additional information about the delivery address. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress line3(String line3) { + this.line3 = line3; + return this; + } + + /** + * Additional information about the delivery address. + * + * @return line3 Additional information about the delivery address. + */ + @JsonProperty(JSON_PROPERTY_LINE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLine3() { + return line3; + } + + /** + * Additional information about the delivery address. + * + * @param line3 Additional information about the delivery address. + */ + @JsonProperty(JSON_PROPERTY_LINE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLine3(String line3) { + this.line3 = line3; + } + + /** + * The full telephone number. + * + * @param mobile The full telephone number. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress mobile(String mobile) { + this.mobile = mobile; + return this; + } + + /** + * The full telephone number. + * + * @return mobile The full telephone number. + */ + @JsonProperty(JSON_PROPERTY_MOBILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMobile() { + return mobile; + } + + /** + * The full telephone number. + * + * @param mobile The full telephone number. + */ + @JsonProperty(JSON_PROPERTY_MOBILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMobile(String mobile) { + this.mobile = mobile; + } + + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @param name The recipient’s name (person or contact), for example ‘John Doe’. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress name(String name) { + this.name = name; + return this; + } + + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @return name The recipient’s name (person or contact), for example ‘John Doe’. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @param name The recipient’s name (person or contact), for example ‘John Doe’. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** + * The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all + * other countries. + * + * @param postalCode The postal code. Maximum length: * 5 digits for addresses in the US. * 10 + * characters for all other countries. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress postalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all + * other countries. + * + * @return postalCode The postal code. Maximum length: * 5 digits for addresses in the US. * 10 + * characters for all other countries. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPostalCode() { + return postalCode; + } + + /** + * The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all + * other countries. + * + * @param postalCode The postal code. Maximum length: * 5 digits for addresses in the US. * 10 + * characters for all other countries. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + /** + * The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in + * the US. + * + * @param stateOrProvince The two-letter ISO 3166-2 state or province code. Maximum length: 2 + * characters for addresses in the US. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress stateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + return this; + } + + /** + * The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in + * the US. + * + * @return stateOrProvince The two-letter ISO 3166-2 state or province code. Maximum length: 2 + * characters for addresses in the US. + */ + @JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStateOrProvince() { + return stateOrProvince; + } + + /** + * The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in + * the US. + * + * @param stateOrProvince The two-letter ISO 3166-2 state or province code. Maximum length: 2 + * characters for addresses in the US. + */ + @JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + } + + /** + * The streetname of the house. + * + * @param street The streetname of the house. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress street(String street) { + this.street = street; + return this; + } + + /** + * The streetname of the house. + * + * @return street The streetname of the house. + */ + @JsonProperty(JSON_PROPERTY_STREET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStreet() { + return street; + } + + /** + * The streetname of the house. + * + * @param street The streetname of the house. + */ + @JsonProperty(JSON_PROPERTY_STREET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStreet(String street) { + this.street = street; + } + + /** Return true if this BulkAddress object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkAddress bulkAddress = (BulkAddress) o; + return Objects.equals(this.city, bulkAddress.city) + && Objects.equals(this.company, bulkAddress.company) + && Objects.equals(this.country, bulkAddress.country) + && Objects.equals(this.email, bulkAddress.email) + && Objects.equals(this.houseNumberOrName, bulkAddress.houseNumberOrName) + && Objects.equals(this.line1, bulkAddress.line1) + && Objects.equals(this.line2, bulkAddress.line2) + && Objects.equals(this.line3, bulkAddress.line3) + && Objects.equals(this.mobile, bulkAddress.mobile) + && Objects.equals(this.name, bulkAddress.name) + && Objects.equals(this.postalCode, bulkAddress.postalCode) + && Objects.equals(this.stateOrProvince, bulkAddress.stateOrProvince) + && Objects.equals(this.street, bulkAddress.street); + } + + @Override + public int hashCode() { + return Objects.hash( + city, + company, + country, + email, + houseNumberOrName, + line1, + line2, + line3, + mobile, + name, + postalCode, + stateOrProvince, + street); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkAddress {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" houseNumberOrName: ").append(toIndentedString(houseNumberOrName)).append("\n"); + sb.append(" line1: ").append(toIndentedString(line1)).append("\n"); + sb.append(" line2: ").append(toIndentedString(line2)).append("\n"); + sb.append(" line3: ").append(toIndentedString(line3)).append("\n"); + sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); + sb.append(" street: ").append(toIndentedString(street)).append("\n"); + 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 "); + } + + /** + * Create an instance of BulkAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkAddress + * @throws JsonProcessingException if the JSON string is invalid with respect to BulkAddress + */ + public static BulkAddress fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, BulkAddress.class); + } + + /** + * Convert an instance of BulkAddress 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/relayedauthorizationwebhooks/Card.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Card.java new file mode 100644 index 000000000..2dd78eb37 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Card.java @@ -0,0 +1,732 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** Card */ +@JsonPropertyOrder({ + Card.JSON_PROPERTY_AUTHENTICATION, + Card.JSON_PROPERTY_BIN, + Card.JSON_PROPERTY_BRAND, + Card.JSON_PROPERTY_BRAND_VARIANT, + Card.JSON_PROPERTY_CARDHOLDER_NAME, + Card.JSON_PROPERTY_CONFIGURATION, + Card.JSON_PROPERTY_CVC, + Card.JSON_PROPERTY_DELIVERY_CONTACT, + Card.JSON_PROPERTY_EXPIRATION, + Card.JSON_PROPERTY_FORM_FACTOR, + Card.JSON_PROPERTY_LAST_FOUR, + Card.JSON_PROPERTY_NUMBER, + Card.JSON_PROPERTY_THREE_D_SECURE, + Card.JSON_PROPERTY_USAGE +}) +public class Card { + public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; + private Authentication authentication; + + public static final String JSON_PROPERTY_BIN = "bin"; + private String bin; + + public static final String JSON_PROPERTY_BRAND = "brand"; + private String brand; + + public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; + private String brandVariant; + + public static final String JSON_PROPERTY_CARDHOLDER_NAME = "cardholderName"; + private String cardholderName; + + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; + private CardConfiguration configuration; + + public static final String JSON_PROPERTY_CVC = "cvc"; + private String cvc; + + public static final String JSON_PROPERTY_DELIVERY_CONTACT = "deliveryContact"; + private DeliveryContact deliveryContact; + + public static final String JSON_PROPERTY_EXPIRATION = "expiration"; + private Expiry expiration; + + /** The form factor of the card. Possible values: **virtual**, **physical**. */ + public enum FormFactorEnum { + PHYSICAL(String.valueOf("physical")), + + UNKNOWN(String.valueOf("unknown")), + + VIRTUAL(String.valueOf("virtual")); + + private static final Logger LOG = Logger.getLogger(FormFactorEnum.class.getName()); + + private String value; + + FormFactorEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FormFactorEnum fromValue(String value) { + for (FormFactorEnum b : FormFactorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "FormFactorEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(FormFactorEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; + private FormFactorEnum formFactor; + + public static final String JSON_PROPERTY_LAST_FOUR = "lastFour"; + private String lastFour; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; + private String threeDSecure; + + public static final String JSON_PROPERTY_USAGE = "usage"; + private String usage; + + public Card() {} + + /** + * authentication + * + * @param authentication + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card authentication(Authentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get authentication + * + * @return authentication + */ + @JsonProperty(JSON_PROPERTY_AUTHENTICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Authentication getAuthentication() { + return authentication; + } + + /** + * authentication + * + * @param authentication + */ + @JsonProperty(JSON_PROPERTY_AUTHENTICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthentication(Authentication authentication) { + this.authentication = authentication; + } + + /** + * The bank identification number (BIN) of the card number. + * + * @param bin The bank identification number (BIN) of the card number. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card bin(String bin) { + this.bin = bin; + return this; + } + + /** + * The bank identification number (BIN) of the card number. + * + * @return bin The bank identification number (BIN) of the card number. + */ + @JsonProperty(JSON_PROPERTY_BIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBin() { + return bin; + } + + /** + * The bank identification number (BIN) of the card number. + * + * @param bin The bank identification number (BIN) of the card number. + */ + @JsonProperty(JSON_PROPERTY_BIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBin(String bin) { + this.bin = bin; + } + + /** + * The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + * + * @param brand The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card brand(String brand) { + this.brand = brand; + return this; + } + + /** + * The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + * + * @return brand The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + */ + @JsonProperty(JSON_PROPERTY_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBrand() { + return brand; + } + + /** + * The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + * + * @param brand The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + */ + @JsonProperty(JSON_PROPERTY_BRAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrand(String brand) { + this.brand = brand; + } + + /** + * The brand variant of the physical or the virtual card. For example, **visadebit** or + * **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your + * integration. + * + * @param brandVariant The brand variant of the physical or the virtual card. For example, + * **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values + * relevant for your integration. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card brandVariant(String brandVariant) { + this.brandVariant = brandVariant; + return this; + } + + /** + * The brand variant of the physical or the virtual card. For example, **visadebit** or + * **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your + * integration. + * + * @return brandVariant The brand variant of the physical or the virtual card. For example, + * **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values + * relevant for your integration. + */ + @JsonProperty(JSON_PROPERTY_BRAND_VARIANT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBrandVariant() { + return brandVariant; + } + + /** + * The brand variant of the physical or the virtual card. For example, **visadebit** or + * **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your + * integration. + * + * @param brandVariant The brand variant of the physical or the virtual card. For example, + * **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values + * relevant for your integration. + */ + @JsonProperty(JSON_PROPERTY_BRAND_VARIANT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrandVariant(String brandVariant) { + this.brandVariant = brandVariant; + } + + /** + * The name of the cardholder. Maximum length: 26 characters. + * + * @param cardholderName The name of the cardholder. Maximum length: 26 characters. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card cardholderName(String cardholderName) { + this.cardholderName = cardholderName; + return this; + } + + /** + * The name of the cardholder. Maximum length: 26 characters. + * + * @return cardholderName The name of the cardholder. Maximum length: 26 characters. + */ + @JsonProperty(JSON_PROPERTY_CARDHOLDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCardholderName() { + return cardholderName; + } + + /** + * The name of the cardholder. Maximum length: 26 characters. + * + * @param cardholderName The name of the cardholder. Maximum length: 26 characters. + */ + @JsonProperty(JSON_PROPERTY_CARDHOLDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardholderName(String cardholderName) { + this.cardholderName = cardholderName; + } + + /** + * configuration + * + * @param configuration + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card configuration(CardConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get configuration + * + * @return configuration + */ + @JsonProperty(JSON_PROPERTY_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardConfiguration getConfiguration() { + return configuration; + } + + /** + * configuration + * + * @param configuration + */ + @JsonProperty(JSON_PROPERTY_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfiguration(CardConfiguration configuration) { + this.configuration = configuration; + } + + /** + * The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the + * `POST` response for single-use virtual cards. + * + * @param cvc The CVC2 value of the card. > The CVC2 is not sent by default. This is only + * returned in the `POST` response for single-use virtual cards. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card cvc(String cvc) { + this.cvc = cvc; + return this; + } + + /** + * The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the + * `POST` response for single-use virtual cards. + * + * @return cvc The CVC2 value of the card. > The CVC2 is not sent by default. This is only + * returned in the `POST` response for single-use virtual cards. + */ + @JsonProperty(JSON_PROPERTY_CVC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCvc() { + return cvc; + } + + /** + * The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the + * `POST` response for single-use virtual cards. + * + * @param cvc The CVC2 value of the card. > The CVC2 is not sent by default. This is only + * returned in the `POST` response for single-use virtual cards. + */ + @JsonProperty(JSON_PROPERTY_CVC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCvc(String cvc) { + this.cvc = cvc; + } + + /** + * deliveryContact + * + * @param deliveryContact + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card deliveryContact(DeliveryContact deliveryContact) { + this.deliveryContact = deliveryContact; + return this; + } + + /** + * Get deliveryContact + * + * @return deliveryContact + */ + @JsonProperty(JSON_PROPERTY_DELIVERY_CONTACT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeliveryContact getDeliveryContact() { + return deliveryContact; + } + + /** + * deliveryContact + * + * @param deliveryContact + */ + @JsonProperty(JSON_PROPERTY_DELIVERY_CONTACT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeliveryContact(DeliveryContact deliveryContact) { + this.deliveryContact = deliveryContact; + } + + /** + * expiration + * + * @param expiration + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card expiration(Expiry expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * + * @return expiration + */ + @JsonProperty(JSON_PROPERTY_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Expiry getExpiration() { + return expiration; + } + + /** + * expiration + * + * @param expiration + */ + @JsonProperty(JSON_PROPERTY_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiration(Expiry expiration) { + this.expiration = expiration; + } + + /** + * The form factor of the card. Possible values: **virtual**, **physical**. + * + * @param formFactor The form factor of the card. Possible values: **virtual**, **physical**. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card formFactor(FormFactorEnum formFactor) { + this.formFactor = formFactor; + return this; + } + + /** + * The form factor of the card. Possible values: **virtual**, **physical**. + * + * @return formFactor The form factor of the card. Possible values: **virtual**, **physical**. + */ + @JsonProperty(JSON_PROPERTY_FORM_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FormFactorEnum getFormFactor() { + return formFactor; + } + + /** + * The form factor of the card. Possible values: **virtual**, **physical**. + * + * @param formFactor The form factor of the card. Possible values: **virtual**, **physical**. + */ + @JsonProperty(JSON_PROPERTY_FORM_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFactor(FormFactorEnum formFactor) { + this.formFactor = formFactor; + } + + /** + * Last last four digits of the card number. + * + * @param lastFour Last last four digits of the card number. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card lastFour(String lastFour) { + this.lastFour = lastFour; + return this; + } + + /** + * Last last four digits of the card number. + * + * @return lastFour Last last four digits of the card number. + */ + @JsonProperty(JSON_PROPERTY_LAST_FOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastFour() { + return lastFour; + } + + /** + * Last last four digits of the card number. + * + * @param lastFour Last last four digits of the card number. + */ + @JsonProperty(JSON_PROPERTY_LAST_FOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastFour(String lastFour) { + this.lastFour = lastFour; + } + + /** + * The primary account number (PAN) of the card. > The PAN is masked by default and returned + * only for single-use virtual cards. + * + * @param number The primary account number (PAN) of the card. > The PAN is masked by default + * and returned only for single-use virtual cards. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card number(String number) { + this.number = number; + return this; + } + + /** + * The primary account number (PAN) of the card. > The PAN is masked by default and returned + * only for single-use virtual cards. + * + * @return number The primary account number (PAN) of the card. > The PAN is masked by default + * and returned only for single-use virtual cards. + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNumber() { + return number; + } + + /** + * The primary account number (PAN) of the card. > The PAN is masked by default and returned + * only for single-use virtual cards. + * + * @param number The primary account number (PAN) of the card. > The PAN is masked by default + * and returned only for single-use virtual cards. + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; + } + + /** + * The 3DS configuration of the physical or the virtual card. Possible values: **fullySupported**, + * **secureCorporate**. > Reach out to your Adyen contact to get the values relevant for your + * integration. + * + * @param threeDSecure The 3DS configuration of the physical or the virtual card. Possible values: + * **fullySupported**, **secureCorporate**. > Reach out to your Adyen contact to get the + * values relevant for your integration. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card threeDSecure(String threeDSecure) { + this.threeDSecure = threeDSecure; + return this; + } + + /** + * The 3DS configuration of the physical or the virtual card. Possible values: **fullySupported**, + * **secureCorporate**. > Reach out to your Adyen contact to get the values relevant for your + * integration. + * + * @return threeDSecure The 3DS configuration of the physical or the virtual card. Possible + * values: **fullySupported**, **secureCorporate**. > Reach out to your Adyen contact to + * get the values relevant for your integration. + */ + @JsonProperty(JSON_PROPERTY_THREE_D_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getThreeDSecure() { + return threeDSecure; + } + + /** + * The 3DS configuration of the physical or the virtual card. Possible values: **fullySupported**, + * **secureCorporate**. > Reach out to your Adyen contact to get the values relevant for your + * integration. + * + * @param threeDSecure The 3DS configuration of the physical or the virtual card. Possible values: + * **fullySupported**, **secureCorporate**. > Reach out to your Adyen contact to get the + * values relevant for your integration. + */ + @JsonProperty(JSON_PROPERTY_THREE_D_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeDSecure(String threeDSecure) { + this.threeDSecure = threeDSecure; + } + + /** + * Specifies how many times the card can be used. Possible values: **singleUse**, **multiUse**. + * > Reach out to your Adyen contact to determine the value relevant for your integration. + * + * @param usage Specifies how many times the card can be used. Possible values: **singleUse**, + * **multiUse**. > Reach out to your Adyen contact to determine the value relevant for your + * integration. + * @return the current {@code Card} instance, allowing for method chaining + */ + public Card usage(String usage) { + this.usage = usage; + return this; + } + + /** + * Specifies how many times the card can be used. Possible values: **singleUse**, **multiUse**. + * > Reach out to your Adyen contact to determine the value relevant for your integration. + * + * @return usage Specifies how many times the card can be used. Possible values: **singleUse**, + * **multiUse**. > Reach out to your Adyen contact to determine the value relevant for your + * integration. + */ + @JsonProperty(JSON_PROPERTY_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsage() { + return usage; + } + + /** + * Specifies how many times the card can be used. Possible values: **singleUse**, **multiUse**. + * > Reach out to your Adyen contact to determine the value relevant for your integration. + * + * @param usage Specifies how many times the card can be used. Possible values: **singleUse**, + * **multiUse**. > Reach out to your Adyen contact to determine the value relevant for your + * integration. + */ + @JsonProperty(JSON_PROPERTY_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsage(String usage) { + this.usage = usage; + } + + /** Return true if this Card object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Card card = (Card) o; + return Objects.equals(this.authentication, card.authentication) + && Objects.equals(this.bin, card.bin) + && Objects.equals(this.brand, card.brand) + && Objects.equals(this.brandVariant, card.brandVariant) + && Objects.equals(this.cardholderName, card.cardholderName) + && Objects.equals(this.configuration, card.configuration) + && Objects.equals(this.cvc, card.cvc) + && Objects.equals(this.deliveryContact, card.deliveryContact) + && Objects.equals(this.expiration, card.expiration) + && Objects.equals(this.formFactor, card.formFactor) + && Objects.equals(this.lastFour, card.lastFour) + && Objects.equals(this.number, card.number) + && Objects.equals(this.threeDSecure, card.threeDSecure) + && Objects.equals(this.usage, card.usage); + } + + @Override + public int hashCode() { + return Objects.hash( + authentication, + bin, + brand, + brandVariant, + cardholderName, + configuration, + cvc, + deliveryContact, + expiration, + formFactor, + lastFour, + number, + threeDSecure, + usage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Card {\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" bin: ").append(toIndentedString(bin)).append("\n"); + sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); + sb.append(" brandVariant: ").append(toIndentedString(brandVariant)).append("\n"); + sb.append(" cardholderName: ").append(toIndentedString(cardholderName)).append("\n"); + sb.append(" configuration: ").append(toIndentedString(configuration)).append("\n"); + sb.append(" cvc: ").append(toIndentedString(cvc)).append("\n"); + sb.append(" deliveryContact: ").append(toIndentedString(deliveryContact)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); + sb.append(" lastFour: ").append(toIndentedString(lastFour)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" threeDSecure: ").append(toIndentedString(threeDSecure)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).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 "); + } + + /** + * Create an instance of Card given an JSON string + * + * @param jsonString JSON string + * @return An instance of Card + * @throws JsonProcessingException if the JSON string is invalid with respect to Card + */ + public static Card fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Card.class); + } + + /** + * Convert an instance of Card 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/relayedauthorizationwebhooks/CardConfiguration.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/CardConfiguration.java new file mode 100644 index 000000000..c65521ce5 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/CardConfiguration.java @@ -0,0 +1,772 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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; + +/** CardConfiguration */ +@JsonPropertyOrder({ + CardConfiguration.JSON_PROPERTY_ACTIVATION, + CardConfiguration.JSON_PROPERTY_ACTIVATION_URL, + CardConfiguration.JSON_PROPERTY_BULK_ADDRESS, + CardConfiguration.JSON_PROPERTY_CARD_IMAGE_ID, + CardConfiguration.JSON_PROPERTY_CARRIER, + CardConfiguration.JSON_PROPERTY_CARRIER_IMAGE_ID, + CardConfiguration.JSON_PROPERTY_CONFIGURATION_PROFILE_ID, + CardConfiguration.JSON_PROPERTY_CURRENCY, + CardConfiguration.JSON_PROPERTY_ENVELOPE, + CardConfiguration.JSON_PROPERTY_INSERT, + CardConfiguration.JSON_PROPERTY_LANGUAGES, + CardConfiguration.JSON_PROPERTY_LOGO_IMAGE_ID, + CardConfiguration.JSON_PROPERTY_PIN_MAILER, + CardConfiguration.JSON_PROPERTY_SHIPMENT_METHOD +}) +public class CardConfiguration { + public static final String JSON_PROPERTY_ACTIVATION = "activation"; + private String activation; + + public static final String JSON_PROPERTY_ACTIVATION_URL = "activationUrl"; + private String activationUrl; + + public static final String JSON_PROPERTY_BULK_ADDRESS = "bulkAddress"; + private BulkAddress bulkAddress; + + public static final String JSON_PROPERTY_CARD_IMAGE_ID = "cardImageId"; + private String cardImageId; + + public static final String JSON_PROPERTY_CARRIER = "carrier"; + private String carrier; + + public static final String JSON_PROPERTY_CARRIER_IMAGE_ID = "carrierImageId"; + private String carrierImageId; + + public static final String JSON_PROPERTY_CONFIGURATION_PROFILE_ID = "configurationProfileId"; + private String configurationProfileId; + + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + public static final String JSON_PROPERTY_ENVELOPE = "envelope"; + private String envelope; + + public static final String JSON_PROPERTY_INSERT = "insert"; + private String insert; + + public static final String JSON_PROPERTY_LANGUAGES = "languages"; + private List languages; + + public static final String JSON_PROPERTY_LOGO_IMAGE_ID = "logoImageId"; + private String logoImageId; + + public static final String JSON_PROPERTY_PIN_MAILER = "pinMailer"; + private String pinMailer; + + public static final String JSON_PROPERTY_SHIPMENT_METHOD = "shipmentMethod"; + private String shipmentMethod; + + public CardConfiguration() {} + + /** + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. + * + * @param activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration activation(String activation) { + this.activation = activation; + return this; + } + + /** + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. + * + * @return activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. + */ + @JsonProperty(JSON_PROPERTY_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getActivation() { + return activation; + } + + /** + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. + * + * @param activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. + */ + @JsonProperty(JSON_PROPERTY_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActivation(String activation) { + this.activation = activation; + } + + /** + * Your app's URL, if you want to activate cards through your app. For example, + * **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the + * carrier. Before you use this field, reach out to your Adyen contact to set up the QR code + * process. Maximum length: 255 characters. + * + * @param activationUrl Your app's URL, if you want to activate cards through your app. For + * example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included + * in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR + * code process. Maximum length: 255 characters. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration activationUrl(String activationUrl) { + this.activationUrl = activationUrl; + return this; + } + + /** + * Your app's URL, if you want to activate cards through your app. For example, + * **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the + * carrier. Before you use this field, reach out to your Adyen contact to set up the QR code + * process. Maximum length: 255 characters. + * + * @return activationUrl Your app's URL, if you want to activate cards through your app. For + * example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included + * in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR + * code process. Maximum length: 255 characters. + */ + @JsonProperty(JSON_PROPERTY_ACTIVATION_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getActivationUrl() { + return activationUrl; + } + + /** + * Your app's URL, if you want to activate cards through your app. For example, + * **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the + * carrier. Before you use this field, reach out to your Adyen contact to set up the QR code + * process. Maximum length: 255 characters. + * + * @param activationUrl Your app's URL, if you want to activate cards through your app. For + * example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included + * in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR + * code process. Maximum length: 255 characters. + */ + @JsonProperty(JSON_PROPERTY_ACTIVATION_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActivationUrl(String activationUrl) { + this.activationUrl = activationUrl; + } + + /** + * bulkAddress + * + * @param bulkAddress + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration bulkAddress(BulkAddress bulkAddress) { + this.bulkAddress = bulkAddress; + return this; + } + + /** + * Get bulkAddress + * + * @return bulkAddress + */ + @JsonProperty(JSON_PROPERTY_BULK_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BulkAddress getBulkAddress() { + return bulkAddress; + } + + /** + * bulkAddress + * + * @param bulkAddress + */ + @JsonProperty(JSON_PROPERTY_BULK_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBulkAddress(BulkAddress bulkAddress) { + this.bulkAddress = bulkAddress; + } + + /** + * The unique identifier of the card image. This image is printed on the full front of the card. + * + * @param cardImageId The unique identifier of the card image. This image is printed on the full + * front of the card. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration cardImageId(String cardImageId) { + this.cardImageId = cardImageId; + return this; + } + + /** + * The unique identifier of the card image. This image is printed on the full front of the card. + * + * @return cardImageId The unique identifier of the card image. This image is printed on the full + * front of the card. + */ + @JsonProperty(JSON_PROPERTY_CARD_IMAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCardImageId() { + return cardImageId; + } + + /** + * The unique identifier of the card image. This image is printed on the full front of the card. + * + * @param cardImageId The unique identifier of the card image. This image is printed on the full + * front of the card. + */ + @JsonProperty(JSON_PROPERTY_CARD_IMAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardImageId(String cardImageId) { + this.cardImageId = cardImageId; + } + + /** + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. + * + * @param carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration carrier(String carrier) { + this.carrier = carrier; + return this; + } + + /** + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. + * + * @return carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_CARRIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCarrier() { + return carrier; + } + + /** + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. + * + * @param carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_CARRIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCarrier(String carrier) { + this.carrier = carrier; + } + + /** + * The unique identifier of the carrier image. This image is printed on the letter to which the + * card is attached. + * + * @param carrierImageId The unique identifier of the carrier image. This image is printed on the + * letter to which the card is attached. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration carrierImageId(String carrierImageId) { + this.carrierImageId = carrierImageId; + return this; + } + + /** + * The unique identifier of the carrier image. This image is printed on the letter to which the + * card is attached. + * + * @return carrierImageId The unique identifier of the carrier image. This image is printed on the + * letter to which the card is attached. + */ + @JsonProperty(JSON_PROPERTY_CARRIER_IMAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCarrierImageId() { + return carrierImageId; + } + + /** + * The unique identifier of the carrier image. This image is printed on the letter to which the + * card is attached. + * + * @param carrierImageId The unique identifier of the carrier image. This image is printed on the + * letter to which the card is attached. + */ + @JsonProperty(JSON_PROPERTY_CARRIER_IMAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCarrierImageId(String carrierImageId) { + this.carrierImageId = carrierImageId; + } + + /** + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. + * + * @param configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration configurationProfileId(String configurationProfileId) { + this.configurationProfileId = configurationProfileId; + return this; + } + + /** + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. + * + * @return configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_CONFIGURATION_PROFILE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConfigurationProfileId() { + return configurationProfileId; + } + + /** + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. + * + * @param configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_CONFIGURATION_PROFILE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigurationProfileId(String configurationProfileId) { + this.configurationProfileId = configurationProfileId; + } + + /** + * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. + * + * @param currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration currency(String currency) { + this.currency = currency; + return this; + } + + /** + * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. + * + * @return currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. + * + * @param currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Overrides the envelope design ID defined in the card configuration profile. + * + * @param envelope Overrides the envelope design ID defined in the card configuration profile. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration envelope(String envelope) { + this.envelope = envelope; + return this; + } + + /** + * Overrides the envelope design ID defined in the card configuration profile. + * + * @return envelope Overrides the envelope design ID defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_ENVELOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnvelope() { + return envelope; + } + + /** + * Overrides the envelope design ID defined in the card configuration profile. + * + * @param envelope Overrides the envelope design ID defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_ENVELOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnvelope(String envelope) { + this.envelope = envelope; + } + + /** + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. + * + * @param insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration insert(String insert) { + this.insert = insert; + return this; + } + + /** + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. + * + * @return insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. + */ + @JsonProperty(JSON_PROPERTY_INSERT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInsert() { + return insert; + } + + /** + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. + * + * @param insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. + */ + @JsonProperty(JSON_PROPERTY_INSERT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInsert(String insert) { + this.insert = insert; + } + + /** + * A list of two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + * language codes of the card. For example, **[en,es]**. + * + * @param languages A list of two-letter + * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes of the + * card. For example, **[en,es]**. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration languages(List languages) { + this.languages = languages; + return this; + } + + public CardConfiguration addLanguagesItem(String languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * A list of two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + * language codes of the card. For example, **[en,es]**. + * + * @return languages A list of two-letter + * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes of the + * card. For example, **[en,es]**. + */ + @JsonProperty(JSON_PROPERTY_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLanguages() { + return languages; + } + + /** + * A list of two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + * language codes of the card. For example, **[en,es]**. + * + * @param languages A list of two-letter + * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language codes of the + * card. For example, **[en,es]**. + */ + @JsonProperty(JSON_PROPERTY_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLanguages(List languages) { + this.languages = languages; + } + + /** + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. + * + * @param logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration logoImageId(String logoImageId) { + this.logoImageId = logoImageId; + return this; + } + + /** + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. + * + * @return logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. + */ + @JsonProperty(JSON_PROPERTY_LOGO_IMAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogoImageId() { + return logoImageId; + } + + /** + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. + * + * @param logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. + */ + @JsonProperty(JSON_PROPERTY_LOGO_IMAGE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoImageId(String logoImageId) { + this.logoImageId = logoImageId; + } + + /** + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. + * + * @param pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration pinMailer(String pinMailer) { + this.pinMailer = pinMailer; + return this; + } + + /** + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. + * + * @return pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_PIN_MAILER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPinMailer() { + return pinMailer; + } + + /** + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. + * + * @param pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_PIN_MAILER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPinMailer(String pinMailer) { + this.pinMailer = pinMailer; + } + + /** + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. + * + * @param shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. + * @return the current {@code CardConfiguration} instance, allowing for method chaining + */ + public CardConfiguration shipmentMethod(String shipmentMethod) { + this.shipmentMethod = shipmentMethod; + return this; + } + + /** + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. + * + * @return shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_SHIPMENT_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShipmentMethod() { + return shipmentMethod; + } + + /** + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. + * + * @param shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. + */ + @JsonProperty(JSON_PROPERTY_SHIPMENT_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShipmentMethod(String shipmentMethod) { + this.shipmentMethod = shipmentMethod; + } + + /** Return true if this CardConfiguration object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardConfiguration cardConfiguration = (CardConfiguration) o; + return Objects.equals(this.activation, cardConfiguration.activation) + && Objects.equals(this.activationUrl, cardConfiguration.activationUrl) + && Objects.equals(this.bulkAddress, cardConfiguration.bulkAddress) + && Objects.equals(this.cardImageId, cardConfiguration.cardImageId) + && Objects.equals(this.carrier, cardConfiguration.carrier) + && Objects.equals(this.carrierImageId, cardConfiguration.carrierImageId) + && Objects.equals(this.configurationProfileId, cardConfiguration.configurationProfileId) + && Objects.equals(this.currency, cardConfiguration.currency) + && Objects.equals(this.envelope, cardConfiguration.envelope) + && Objects.equals(this.insert, cardConfiguration.insert) + && Objects.equals(this.languages, cardConfiguration.languages) + && Objects.equals(this.logoImageId, cardConfiguration.logoImageId) + && Objects.equals(this.pinMailer, cardConfiguration.pinMailer) + && Objects.equals(this.shipmentMethod, cardConfiguration.shipmentMethod); + } + + @Override + public int hashCode() { + return Objects.hash( + activation, + activationUrl, + bulkAddress, + cardImageId, + carrier, + carrierImageId, + configurationProfileId, + currency, + envelope, + insert, + languages, + logoImageId, + pinMailer, + shipmentMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardConfiguration {\n"); + sb.append(" activation: ").append(toIndentedString(activation)).append("\n"); + sb.append(" activationUrl: ").append(toIndentedString(activationUrl)).append("\n"); + sb.append(" bulkAddress: ").append(toIndentedString(bulkAddress)).append("\n"); + sb.append(" cardImageId: ").append(toIndentedString(cardImageId)).append("\n"); + sb.append(" carrier: ").append(toIndentedString(carrier)).append("\n"); + sb.append(" carrierImageId: ").append(toIndentedString(carrierImageId)).append("\n"); + sb.append(" configurationProfileId: ") + .append(toIndentedString(configurationProfileId)) + .append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" envelope: ").append(toIndentedString(envelope)).append("\n"); + sb.append(" insert: ").append(toIndentedString(insert)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" logoImageId: ").append(toIndentedString(logoImageId)).append("\n"); + sb.append(" pinMailer: ").append(toIndentedString(pinMailer)).append("\n"); + sb.append(" shipmentMethod: ").append(toIndentedString(shipmentMethod)).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 "); + } + + /** + * Create an instance of CardConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardConfiguration + * @throws JsonProcessingException if the JSON string is invalid with respect to CardConfiguration + */ + public static CardConfiguration fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CardConfiguration.class); + } + + /** + * Convert an instance of CardConfiguration 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/relayedauthorizationwebhooks/DeliveryAddress.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/DeliveryAddress.java new file mode 100644 index 000000000..f41759944 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/DeliveryAddress.java @@ -0,0 +1,389 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** DeliveryAddress */ +@JsonPropertyOrder({ + DeliveryAddress.JSON_PROPERTY_CITY, + DeliveryAddress.JSON_PROPERTY_COUNTRY, + DeliveryAddress.JSON_PROPERTY_LINE1, + DeliveryAddress.JSON_PROPERTY_LINE2, + DeliveryAddress.JSON_PROPERTY_LINE3, + DeliveryAddress.JSON_PROPERTY_POSTAL_CODE, + DeliveryAddress.JSON_PROPERTY_STATE_OR_PROVINCE +}) +public class DeliveryAddress { + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private String country; + + public static final String JSON_PROPERTY_LINE1 = "line1"; + private String line1; + + public static final String JSON_PROPERTY_LINE2 = "line2"; + private String line2; + + public static final String JSON_PROPERTY_LINE3 = "line3"; + private String line3; + + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; + private String postalCode; + + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; + private String stateOrProvince; + + public DeliveryAddress() {} + + /** + * The name of the city. + * + * @param city The name of the city. + * @return the current {@code DeliveryAddress} instance, allowing for method chaining + */ + public DeliveryAddress city(String city) { + this.city = city; + return this; + } + + /** + * The name of the city. + * + * @return city The name of the city. + */ + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCity() { + return city; + } + + /** + * The name of the city. + * + * @param city The name of the city. + */ + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(String city) { + this.city = city; + } + + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don't + * know the country or are not collecting the country from the shopper, provide + * `country` as `ZZ`. + * + * @param country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If + * you don't know the country or are not collecting the country from the shopper, provide + * `country` as `ZZ`. + * @return the current {@code DeliveryAddress} instance, allowing for method chaining + */ + public DeliveryAddress country(String country) { + this.country = country; + return this; + } + + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don't + * know the country or are not collecting the country from the shopper, provide + * `country` as `ZZ`. + * + * @return country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If + * you don't know the country or are not collecting the country from the shopper, provide + * `country` as `ZZ`. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountry() { + return country; + } + + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don't + * know the country or are not collecting the country from the shopper, provide + * `country` as `ZZ`. + * + * @param country The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If + * you don't know the country or are not collecting the country from the shopper, provide + * `country` as `ZZ`. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountry(String country) { + this.country = country; + } + + /** + * The name of the street and the number of the building. For example: **Simon Carmiggeltstraat + * 6-50**. + * + * @param line1 The name of the street and the number of the building. For example: **Simon + * Carmiggeltstraat 6-50**. + * @return the current {@code DeliveryAddress} instance, allowing for method chaining + */ + public DeliveryAddress line1(String line1) { + this.line1 = line1; + return this; + } + + /** + * The name of the street and the number of the building. For example: **Simon Carmiggeltstraat + * 6-50**. + * + * @return line1 The name of the street and the number of the building. For example: **Simon + * Carmiggeltstraat 6-50**. + */ + @JsonProperty(JSON_PROPERTY_LINE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLine1() { + return line1; + } + + /** + * The name of the street and the number of the building. For example: **Simon Carmiggeltstraat + * 6-50**. + * + * @param line1 The name of the street and the number of the building. For example: **Simon + * Carmiggeltstraat 6-50**. + */ + @JsonProperty(JSON_PROPERTY_LINE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLine1(String line1) { + this.line1 = line1; + } + + /** + * Additional information about the delivery address. For example, an apartment number. + * + * @param line2 Additional information about the delivery address. For example, an apartment + * number. + * @return the current {@code DeliveryAddress} instance, allowing for method chaining + */ + public DeliveryAddress line2(String line2) { + this.line2 = line2; + return this; + } + + /** + * Additional information about the delivery address. For example, an apartment number. + * + * @return line2 Additional information about the delivery address. For example, an apartment + * number. + */ + @JsonProperty(JSON_PROPERTY_LINE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLine2() { + return line2; + } + + /** + * Additional information about the delivery address. For example, an apartment number. + * + * @param line2 Additional information about the delivery address. For example, an apartment + * number. + */ + @JsonProperty(JSON_PROPERTY_LINE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLine2(String line2) { + this.line2 = line2; + } + + /** + * Additional information about the delivery address. + * + * @param line3 Additional information about the delivery address. + * @return the current {@code DeliveryAddress} instance, allowing for method chaining + */ + public DeliveryAddress line3(String line3) { + this.line3 = line3; + return this; + } + + /** + * Additional information about the delivery address. + * + * @return line3 Additional information about the delivery address. + */ + @JsonProperty(JSON_PROPERTY_LINE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLine3() { + return line3; + } + + /** + * Additional information about the delivery address. + * + * @param line3 Additional information about the delivery address. + */ + @JsonProperty(JSON_PROPERTY_LINE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLine3(String line3) { + this.line3 = line3; + } + + /** + * The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an + * address in all other countries. + * + * @param postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 + * characters for an address in all other countries. + * @return the current {@code DeliveryAddress} instance, allowing for method chaining + */ + public DeliveryAddress postalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an + * address in all other countries. + * + * @return postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 + * characters for an address in all other countries. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPostalCode() { + return postalCode; + } + + /** + * The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an + * address in all other countries. + * + * @param postalCode The postal code. Maximum length: * 5 digits for an address in the US. * 10 + * characters for an address in all other countries. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + /** + * The state or province code, maximum 3 characters. For example, **CA** for California in the US + * or **ON** for Ontario in Canada. > Required for the US and Canada. + * + * @param stateOrProvince The state or province code, maximum 3 characters. For example, **CA** + * for California in the US or **ON** for Ontario in Canada. > Required for the US and + * Canada. + * @return the current {@code DeliveryAddress} instance, allowing for method chaining + */ + public DeliveryAddress stateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + return this; + } + + /** + * The state or province code, maximum 3 characters. For example, **CA** for California in the US + * or **ON** for Ontario in Canada. > Required for the US and Canada. + * + * @return stateOrProvince The state or province code, maximum 3 characters. For example, **CA** + * for California in the US or **ON** for Ontario in Canada. > Required for the US and + * Canada. + */ + @JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStateOrProvince() { + return stateOrProvince; + } + + /** + * The state or province code, maximum 3 characters. For example, **CA** for California in the US + * or **ON** for Ontario in Canada. > Required for the US and Canada. + * + * @param stateOrProvince The state or province code, maximum 3 characters. For example, **CA** + * for California in the US or **ON** for Ontario in Canada. > Required for the US and + * Canada. + */ + @JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + } + + /** Return true if this DeliveryAddress object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeliveryAddress deliveryAddress = (DeliveryAddress) o; + return Objects.equals(this.city, deliveryAddress.city) + && Objects.equals(this.country, deliveryAddress.country) + && Objects.equals(this.line1, deliveryAddress.line1) + && Objects.equals(this.line2, deliveryAddress.line2) + && Objects.equals(this.line3, deliveryAddress.line3) + && Objects.equals(this.postalCode, deliveryAddress.postalCode) + && Objects.equals(this.stateOrProvince, deliveryAddress.stateOrProvince); + } + + @Override + public int hashCode() { + return Objects.hash(city, country, line1, line2, line3, postalCode, stateOrProvince); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeliveryAddress {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" line1: ").append(toIndentedString(line1)).append("\n"); + sb.append(" line2: ").append(toIndentedString(line2)).append("\n"); + sb.append(" line3: ").append(toIndentedString(line3)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).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 "); + } + + /** + * Create an instance of DeliveryAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeliveryAddress + * @throws JsonProcessingException if the JSON string is invalid with respect to DeliveryAddress + */ + public static DeliveryAddress fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DeliveryAddress.class); + } + + /** + * Convert an instance of DeliveryAddress 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/relayedauthorizationwebhooks/DeliveryContact.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/DeliveryContact.java new file mode 100644 index 000000000..189d5bb94 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/DeliveryContact.java @@ -0,0 +1,314 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** DeliveryContact */ +@JsonPropertyOrder({ + DeliveryContact.JSON_PROPERTY_ADDRESS, + DeliveryContact.JSON_PROPERTY_COMPANY, + DeliveryContact.JSON_PROPERTY_EMAIL, + DeliveryContact.JSON_PROPERTY_NAME, + DeliveryContact.JSON_PROPERTY_PHONE, + DeliveryContact.JSON_PROPERTY_WEB_ADDRESS +}) +public class DeliveryContact { + public static final String JSON_PROPERTY_ADDRESS = "address"; + private DeliveryAddress address; + + public static final String JSON_PROPERTY_COMPANY = "company"; + private String company; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_NAME = "name"; + private Name name; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private Phone phone; + + public static final String JSON_PROPERTY_WEB_ADDRESS = "webAddress"; + private String webAddress; + + public DeliveryContact() {} + + /** + * address + * + * @param address + * @return the current {@code DeliveryContact} instance, allowing for method chaining + */ + public DeliveryContact address(DeliveryAddress address) { + this.address = address; + return this; + } + + /** + * Get address + * + * @return address + */ + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeliveryAddress getAddress() { + return address; + } + + /** + * address + * + * @param address + */ + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(DeliveryAddress address) { + this.address = address; + } + + /** + * The company name of the contact. + * + * @param company The company name of the contact. + * @return the current {@code DeliveryContact} instance, allowing for method chaining + */ + public DeliveryContact company(String company) { + this.company = company; + return this; + } + + /** + * The company name of the contact. + * + * @return company The company name of the contact. + */ + @JsonProperty(JSON_PROPERTY_COMPANY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCompany() { + return company; + } + + /** + * The company name of the contact. + * + * @param company The company name of the contact. + */ + @JsonProperty(JSON_PROPERTY_COMPANY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompany(String company) { + this.company = company; + } + + /** + * The email address of the contact. + * + * @param email The email address of the contact. + * @return the current {@code DeliveryContact} instance, allowing for method chaining + */ + public DeliveryContact email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the contact. + * + * @return email The email address of the contact. + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + /** + * The email address of the contact. + * + * @param email The email address of the contact. + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + /** + * name + * + * @param name + * @return the current {@code DeliveryContact} instance, allowing for method chaining + */ + public DeliveryContact name(Name name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Name getName() { + return name; + } + + /** + * name + * + * @param name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(Name name) { + this.name = name; + } + + /** + * phone + * + * @param phone + * @return the current {@code DeliveryContact} instance, allowing for method chaining + */ + public DeliveryContact phone(Phone phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * + * @return phone + */ + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Phone getPhone() { + return phone; + } + + /** + * phone + * + * @param phone + */ + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(Phone phone) { + this.phone = phone; + } + + /** + * The URL of the contact's website. + * + * @param webAddress The URL of the contact's website. + * @return the current {@code DeliveryContact} instance, allowing for method chaining + */ + public DeliveryContact webAddress(String webAddress) { + this.webAddress = webAddress; + return this; + } + + /** + * The URL of the contact's website. + * + * @return webAddress The URL of the contact's website. + */ + @JsonProperty(JSON_PROPERTY_WEB_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWebAddress() { + return webAddress; + } + + /** + * The URL of the contact's website. + * + * @param webAddress The URL of the contact's website. + */ + @JsonProperty(JSON_PROPERTY_WEB_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebAddress(String webAddress) { + this.webAddress = webAddress; + } + + /** Return true if this DeliveryContact object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeliveryContact deliveryContact = (DeliveryContact) o; + return Objects.equals(this.address, deliveryContact.address) + && Objects.equals(this.company, deliveryContact.company) + && Objects.equals(this.email, deliveryContact.email) + && Objects.equals(this.name, deliveryContact.name) + && Objects.equals(this.phone, deliveryContact.phone) + && Objects.equals(this.webAddress, deliveryContact.webAddress); + } + + @Override + public int hashCode() { + return Objects.hash(address, company, email, name, phone, webAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeliveryContact {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" webAddress: ").append(toIndentedString(webAddress)).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 "); + } + + /** + * Create an instance of DeliveryContact given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeliveryContact + * @throws JsonProcessingException if the JSON string is invalid with respect to DeliveryContact + */ + public static DeliveryContact fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DeliveryContact.class); + } + + /** + * Convert an instance of DeliveryContact 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/relayedauthorizationwebhooks/Expiry.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Expiry.java new file mode 100644 index 000000000..c1523b6b1 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Expiry.java @@ -0,0 +1,154 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** Expiry */ +@JsonPropertyOrder({Expiry.JSON_PROPERTY_MONTH, Expiry.JSON_PROPERTY_YEAR}) +public class Expiry { + public static final String JSON_PROPERTY_MONTH = "month"; + private String month; + + public static final String JSON_PROPERTY_YEAR = "year"; + private String year; + + public Expiry() {} + + /** + * The month in which the card will expire. + * + * @param month The month in which the card will expire. + * @return the current {@code Expiry} instance, allowing for method chaining + */ + public Expiry month(String month) { + this.month = month; + return this; + } + + /** + * The month in which the card will expire. + * + * @return month The month in which the card will expire. + */ + @JsonProperty(JSON_PROPERTY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMonth() { + return month; + } + + /** + * The month in which the card will expire. + * + * @param month The month in which the card will expire. + */ + @JsonProperty(JSON_PROPERTY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMonth(String month) { + this.month = month; + } + + /** + * The year in which the card will expire. + * + * @param year The year in which the card will expire. + * @return the current {@code Expiry} instance, allowing for method chaining + */ + public Expiry year(String year) { + this.year = year; + return this; + } + + /** + * The year in which the card will expire. + * + * @return year The year in which the card will expire. + */ + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getYear() { + return year; + } + + /** + * The year in which the card will expire. + * + * @param year The year in which the card will expire. + */ + @JsonProperty(JSON_PROPERTY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setYear(String year) { + this.year = year; + } + + /** Return true if this Expiry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Expiry expiry = (Expiry) o; + return Objects.equals(this.month, expiry.month) && Objects.equals(this.year, expiry.year); + } + + @Override + public int hashCode() { + return Objects.hash(month, year); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Expiry {\n"); + sb.append(" month: ").append(toIndentedString(month)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).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 "); + } + + /** + * Create an instance of Expiry given an JSON string + * + * @param jsonString JSON string + * @return An instance of Expiry + * @throws JsonProcessingException if the JSON string is invalid with respect to Expiry + */ + public static Expiry fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Expiry.class); + } + + /** + * Convert an instance of Expiry 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/relayedauthorizationwebhooks/IbanAccountIdentification.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/IbanAccountIdentification.java new file mode 100644 index 000000000..1d76f3a1d --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/IbanAccountIdentification.java @@ -0,0 +1,209 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** IbanAccountIdentification */ +@JsonPropertyOrder({ + IbanAccountIdentification.JSON_PROPERTY_IBAN, + IbanAccountIdentification.JSON_PROPERTY_TYPE +}) +public class IbanAccountIdentification { + public static final String JSON_PROPERTY_IBAN = "iban"; + private String iban; + + /** **iban** */ + public enum TypeEnum { + IBAN(String.valueOf("iban")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public IbanAccountIdentification() {} + + /** + * The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @param iban The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * @return the current {@code IbanAccountIdentification} instance, allowing for method chaining + */ + public IbanAccountIdentification iban(String iban) { + this.iban = iban; + return this; + } + + /** + * The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @return iban The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + */ + @JsonProperty(JSON_PROPERTY_IBAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIban() { + return iban; + } + + /** + * The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * + * @param iban The international bank account number as defined in the + * [ISO-13616](https://www.iso.org/standard/81090.html) standard. + */ + @JsonProperty(JSON_PROPERTY_IBAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIban(String iban) { + this.iban = iban; + } + + /** + * **iban** + * + * @param type **iban** + * @return the current {@code IbanAccountIdentification} instance, allowing for method chaining + */ + public IbanAccountIdentification type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * **iban** + * + * @return type **iban** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * **iban** + * + * @param type **iban** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + /** Return true if this IbanAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IbanAccountIdentification ibanAccountIdentification = (IbanAccountIdentification) o; + return Objects.equals(this.iban, ibanAccountIdentification.iban) + && Objects.equals(this.type, ibanAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(iban, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IbanAccountIdentification {\n"); + sb.append(" iban: ").append(toIndentedString(iban)).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 "); + } + + /** + * Create an instance of IbanAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of IbanAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * IbanAccountIdentification + */ + public static IbanAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, IbanAccountIdentification.class); + } + + /** + * Convert an instance of IbanAccountIdentification 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/relayedauthorizationwebhooks/JSON.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/JSON.java new file mode 100644 index 000000000..6362cb83b --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/JSON.java @@ -0,0 +1,251 @@ +package com.adyen.model.relayedauthorizationwebhooks; + +import com.adyen.serializer.ByteArrayDeserializer; +import com.adyen.serializer.ByteArraySerializer; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import jakarta.ws.rs.core.GenericType; +import jakarta.ws.rs.ext.ContextResolver; +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +public class JSON implements ContextResolver { + private static ObjectMapper mapper; + + private JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, true); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.registerModule(new JavaTimeModule()); + // Custom ByteSerializer + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(byte[].class, new ByteArraySerializer()); + simpleModule.addDeserializer(byte[].class, new ByteArrayDeserializer()); + mapper.registerModule(simpleModule); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public static ObjectMapper getMapper() { + return mapper; + } + + /** + * Returns the target model class that should be used to deserialize the input data. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } + return null; + } + + /** Helper class to register the discriminator mappings. */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. This + * function can be invoked for anyOf/oneOf composed models with discriminator mappings. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + *

The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, so + * it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf( + Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** A map of discriminators for all model classes. */ + private static final Map, ClassDiscriminatorMapping> modelDiscriminators = + new HashMap, ClassDiscriminatorMapping>(); + + /** A map of oneOf/anyOf descendants for each model class. */ + private static final Map, Map> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator( + Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = + new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants( + Class modelClass, Map descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/src/main/java/com/adyen/model/relayedauthorizationwebhooks/MerchantData.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/MerchantData.java new file mode 100644 index 000000000..5826d83ed --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/MerchantData.java @@ -0,0 +1,275 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** MerchantData */ +@JsonPropertyOrder({ + MerchantData.JSON_PROPERTY_ACQUIRER_ID, + MerchantData.JSON_PROPERTY_MCC, + MerchantData.JSON_PROPERTY_MERCHANT_ID, + MerchantData.JSON_PROPERTY_NAME_LOCATION, + MerchantData.JSON_PROPERTY_POSTAL_CODE +}) +public class MerchantData { + public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; + private String acquirerId; + + public static final String JSON_PROPERTY_MCC = "mcc"; + private String mcc; + + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; + private String merchantId; + + public static final String JSON_PROPERTY_NAME_LOCATION = "nameLocation"; + private NameLocation nameLocation; + + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; + private String postalCode; + + public MerchantData() {} + + /** + * The unique identifier of the merchant's acquirer. + * + * @param acquirerId The unique identifier of the merchant's acquirer. + * @return the current {@code MerchantData} instance, allowing for method chaining + */ + public MerchantData acquirerId(String acquirerId) { + this.acquirerId = acquirerId; + return this; + } + + /** + * The unique identifier of the merchant's acquirer. + * + * @return acquirerId The unique identifier of the merchant's acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAcquirerId() { + return acquirerId; + } + + /** + * The unique identifier of the merchant's acquirer. + * + * @param acquirerId The unique identifier of the merchant's acquirer. + */ + @JsonProperty(JSON_PROPERTY_ACQUIRER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcquirerId(String acquirerId) { + this.acquirerId = acquirerId; + } + + /** + * The merchant category code. + * + * @param mcc The merchant category code. + * @return the current {@code MerchantData} instance, allowing for method chaining + */ + public MerchantData mcc(String mcc) { + this.mcc = mcc; + return this; + } + + /** + * The merchant category code. + * + * @return mcc The merchant category code. + */ + @JsonProperty(JSON_PROPERTY_MCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMcc() { + return mcc; + } + + /** + * The merchant category code. + * + * @param mcc The merchant category code. + */ + @JsonProperty(JSON_PROPERTY_MCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMcc(String mcc) { + this.mcc = mcc; + } + + /** + * The unique identifier of the merchant. + * + * @param merchantId The unique identifier of the merchant. + * @return the current {@code MerchantData} instance, allowing for method chaining + */ + public MerchantData merchantId(String merchantId) { + this.merchantId = merchantId; + return this; + } + + /** + * The unique identifier of the merchant. + * + * @return merchantId The unique identifier of the merchant. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMerchantId() { + return merchantId; + } + + /** + * The unique identifier of the merchant. + * + * @param merchantId The unique identifier of the merchant. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantId(String merchantId) { + this.merchantId = merchantId; + } + + /** + * nameLocation + * + * @param nameLocation + * @return the current {@code MerchantData} instance, allowing for method chaining + */ + public MerchantData nameLocation(NameLocation nameLocation) { + this.nameLocation = nameLocation; + return this; + } + + /** + * Get nameLocation + * + * @return nameLocation + */ + @JsonProperty(JSON_PROPERTY_NAME_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NameLocation getNameLocation() { + return nameLocation; + } + + /** + * nameLocation + * + * @param nameLocation + */ + @JsonProperty(JSON_PROPERTY_NAME_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameLocation(NameLocation nameLocation) { + this.nameLocation = nameLocation; + } + + /** + * The postal code of the merchant. + * + * @param postalCode The postal code of the merchant. + * @return the current {@code MerchantData} instance, allowing for method chaining + */ + public MerchantData postalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * The postal code of the merchant. + * + * @return postalCode The postal code of the merchant. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPostalCode() { + return postalCode; + } + + /** + * The postal code of the merchant. + * + * @param postalCode The postal code of the merchant. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + /** Return true if this MerchantData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MerchantData merchantData = (MerchantData) o; + return Objects.equals(this.acquirerId, merchantData.acquirerId) + && Objects.equals(this.mcc, merchantData.mcc) + && Objects.equals(this.merchantId, merchantData.merchantId) + && Objects.equals(this.nameLocation, merchantData.nameLocation) + && Objects.equals(this.postalCode, merchantData.postalCode); + } + + @Override + public int hashCode() { + return Objects.hash(acquirerId, mcc, merchantId, nameLocation, postalCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MerchantData {\n"); + sb.append(" acquirerId: ").append(toIndentedString(acquirerId)).append("\n"); + sb.append(" mcc: ").append(toIndentedString(mcc)).append("\n"); + sb.append(" merchantId: ").append(toIndentedString(merchantId)).append("\n"); + sb.append(" nameLocation: ").append(toIndentedString(nameLocation)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).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 "); + } + + /** + * Create an instance of MerchantData given an JSON string + * + * @param jsonString JSON string + * @return An instance of MerchantData + * @throws JsonProcessingException if the JSON string is invalid with respect to MerchantData + */ + public static MerchantData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, MerchantData.class); + } + + /** + * Convert an instance of MerchantData 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/relayedauthorizationwebhooks/Name.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Name.java new file mode 100644 index 000000000..0ce474124 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Name.java @@ -0,0 +1,155 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** Name */ +@JsonPropertyOrder({Name.JSON_PROPERTY_FIRST_NAME, Name.JSON_PROPERTY_LAST_NAME}) +public class Name { + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public Name() {} + + /** + * The first name. + * + * @param firstName The first name. + * @return the current {@code Name} instance, allowing for method chaining + */ + public Name firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * The first name. + * + * @return firstName The first name. + */ + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { + return firstName; + } + + /** + * The first name. + * + * @param firstName The first name. + */ + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * The last name. + * + * @param lastName The last name. + * @return the current {@code Name} instance, allowing for method chaining + */ + public Name lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The last name. + * + * @return lastName The last name. + */ + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { + return lastName; + } + + /** + * The last name. + * + * @param lastName The last name. + */ + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** Return true if this Name object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.firstName, name.firstName) + && Objects.equals(this.lastName, name.lastName); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).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 "); + } + + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws JsonProcessingException if the JSON string is invalid with respect to Name + */ + public static Name fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Name.class); + } + + /** + * Convert an instance of Name 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/relayedauthorizationwebhooks/NameLocation.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/NameLocation.java new file mode 100644 index 000000000..55260adf4 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/NameLocation.java @@ -0,0 +1,332 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** NameLocation */ +@JsonPropertyOrder({ + NameLocation.JSON_PROPERTY_CITY, + NameLocation.JSON_PROPERTY_COUNTRY, + NameLocation.JSON_PROPERTY_COUNTRY_OF_ORIGIN, + NameLocation.JSON_PROPERTY_NAME, + NameLocation.JSON_PROPERTY_RAW_DATA, + NameLocation.JSON_PROPERTY_STATE +}) +public class NameLocation { + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private String country; + + public static final String JSON_PROPERTY_COUNTRY_OF_ORIGIN = "countryOfOrigin"; + private String countryOfOrigin; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RAW_DATA = "rawData"; + private String rawData; + + public static final String JSON_PROPERTY_STATE = "state"; + private String state; + + public NameLocation() {} + + /** + * The city where the merchant is located. + * + * @param city The city where the merchant is located. + * @return the current {@code NameLocation} instance, allowing for method chaining + */ + public NameLocation city(String city) { + this.city = city; + return this; + } + + /** + * The city where the merchant is located. + * + * @return city The city where the merchant is located. + */ + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCity() { + return city; + } + + /** + * The city where the merchant is located. + * + * @param city The city where the merchant is located. + */ + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(String city) { + this.city = city; + } + + /** + * The country where the merchant is located in [three-letter country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * + * @param country The country where the merchant is located in [three-letter country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * @return the current {@code NameLocation} instance, allowing for method chaining + */ + public NameLocation country(String country) { + this.country = country; + return this; + } + + /** + * The country where the merchant is located in [three-letter country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * + * @return country The country where the merchant is located in [three-letter country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountry() { + return country; + } + + /** + * The country where the merchant is located in [three-letter country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * + * @param country The country where the merchant is located in [three-letter country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountry(String country) { + this.country = country; + } + + /** + * The home country in [three-digit country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for government-controlled + * merchants such as embassies. + * + * @param countryOfOrigin The home country in [three-digit country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for + * government-controlled merchants such as embassies. + * @return the current {@code NameLocation} instance, allowing for method chaining + */ + public NameLocation countryOfOrigin(String countryOfOrigin) { + this.countryOfOrigin = countryOfOrigin; + return this; + } + + /** + * The home country in [three-digit country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for government-controlled + * merchants such as embassies. + * + * @return countryOfOrigin The home country in [three-digit country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for + * government-controlled merchants such as embassies. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY_OF_ORIGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountryOfOrigin() { + return countryOfOrigin; + } + + /** + * The home country in [three-digit country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for government-controlled + * merchants such as embassies. + * + * @param countryOfOrigin The home country in [three-digit country + * code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for + * government-controlled merchants such as embassies. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY_OF_ORIGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountryOfOrigin(String countryOfOrigin) { + this.countryOfOrigin = countryOfOrigin; + } + + /** + * The name of the merchant's shop or service. + * + * @param name The name of the merchant's shop or service. + * @return the current {@code NameLocation} instance, allowing for method chaining + */ + public NameLocation name(String name) { + this.name = name; + return this; + } + + /** + * The name of the merchant's shop or service. + * + * @return name The name of the merchant's shop or service. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The name of the merchant's shop or service. + * + * @param name The name of the merchant's shop or service. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** + * The raw data. + * + * @param rawData The raw data. + * @return the current {@code NameLocation} instance, allowing for method chaining + */ + public NameLocation rawData(String rawData) { + this.rawData = rawData; + return this; + } + + /** + * The raw data. + * + * @return rawData The raw data. + */ + @JsonProperty(JSON_PROPERTY_RAW_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRawData() { + return rawData; + } + + /** + * The raw data. + * + * @param rawData The raw data. + */ + @JsonProperty(JSON_PROPERTY_RAW_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRawData(String rawData) { + this.rawData = rawData; + } + + /** + * The state where the merchant is located. + * + * @param state The state where the merchant is located. + * @return the current {@code NameLocation} instance, allowing for method chaining + */ + public NameLocation state(String state) { + this.state = state; + return this; + } + + /** + * The state where the merchant is located. + * + * @return state The state where the merchant is located. + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getState() { + return state; + } + + /** + * The state where the merchant is located. + * + * @param state The state where the merchant is located. + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(String state) { + this.state = state; + } + + /** Return true if this NameLocation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameLocation nameLocation = (NameLocation) o; + return Objects.equals(this.city, nameLocation.city) + && Objects.equals(this.country, nameLocation.country) + && Objects.equals(this.countryOfOrigin, nameLocation.countryOfOrigin) + && Objects.equals(this.name, nameLocation.name) + && Objects.equals(this.rawData, nameLocation.rawData) + && Objects.equals(this.state, nameLocation.state); + } + + @Override + public int hashCode() { + return Objects.hash(city, country, countryOfOrigin, name, rawData, state); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameLocation {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" countryOfOrigin: ").append(toIndentedString(countryOfOrigin)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rawData: ").append(toIndentedString(rawData)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).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 "); + } + + /** + * Create an instance of NameLocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of NameLocation + * @throws JsonProcessingException if the JSON string is invalid with respect to NameLocation + */ + public static NameLocation fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, NameLocation.class); + } + + /** + * Convert an instance of NameLocation 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/relayedauthorizationwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/PaymentInstrument.java new file mode 100644 index 000000000..90d47d096 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/PaymentInstrument.java @@ -0,0 +1,989 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** PaymentInstrument */ +@JsonPropertyOrder({ + PaymentInstrument.JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS, + PaymentInstrument.JSON_PROPERTY_BALANCE_ACCOUNT_ID, + PaymentInstrument.JSON_PROPERTY_BANK_ACCOUNT, + PaymentInstrument.JSON_PROPERTY_CARD, + PaymentInstrument.JSON_PROPERTY_DESCRIPTION, + PaymentInstrument.JSON_PROPERTY_ID, + PaymentInstrument.JSON_PROPERTY_ISSUING_COUNTRY_CODE, + PaymentInstrument.JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID, + PaymentInstrument.JSON_PROPERTY_REFERENCE, + PaymentInstrument.JSON_PROPERTY_REPLACED_BY_ID, + PaymentInstrument.JSON_PROPERTY_REPLACEMENT_OF_ID, + PaymentInstrument.JSON_PROPERTY_STATUS, + PaymentInstrument.JSON_PROPERTY_STATUS_COMMENT, + PaymentInstrument.JSON_PROPERTY_STATUS_REASON, + PaymentInstrument.JSON_PROPERTY_TYPE +}) +public class PaymentInstrument { + public static final String JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS = + "additionalBankAccountIdentifications"; + @Deprecated // deprecated since Authorization webhooks v2: Please use `bankAccount` object instead + private List + additionalBankAccountIdentifications; + + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; + private String balanceAccountId; + + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; + private BankAccountDetails bankAccount; + + public static final String JSON_PROPERTY_CARD = "card"; + private Card card; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; + private String issuingCountryCode; + + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; + private String paymentInstrumentGroupId; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + public static final String JSON_PROPERTY_REPLACED_BY_ID = "replacedById"; + private String replacedById; + + public static final String JSON_PROPERTY_REPLACEMENT_OF_ID = "replacementOfId"; + private String replacementOfId; + + /** + * The status of the payment instrument. If a status is not specified when creating a payment + * instrument, it is set to **active** by default. However, there can be exceptions for cards + * based on the `card.formFactor` and the `issuingCountryCode`. For example, + * when issuing physical cards in the US, the default status is **inactive**. Possible values: * + * **active**: The payment instrument is active and can be used to make payments. * **inactive**: + * The payment instrument is inactive and cannot be used to make payments. * **suspended**: The + * payment instrument is suspended, either because it was stolen or lost. * **closed**: The + * payment instrument is permanently closed. This action cannot be undone. + */ + public enum StatusEnum { + ACTIVE(String.valueOf("active")), + + CLOSED(String.valueOf("closed")), + + INACTIVE(String.valueOf("inactive")), + + SUSPENDED(String.valueOf("suspended")); + + private static final Logger LOG = Logger.getLogger(StatusEnum.class.getName()); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "StatusEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(StatusEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_STATUS_COMMENT = "statusComment"; + private String statusComment; + + /** + * The reason for the status of the payment instrument. Possible values: **accountClosure**, + * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, + * **transactionRule**, **other**. If the reason is **other**, you must also send the + * `statusComment` parameter describing the status change. + */ + public enum StatusReasonEnum { + ACCOUNTCLOSURE(String.valueOf("accountClosure")), + + DAMAGED(String.valueOf("damaged")), + + ENDOFLIFE(String.valueOf("endOfLife")), + + EXPIRED(String.valueOf("expired")), + + LOST(String.valueOf("lost")), + + OTHER(String.valueOf("other")), + + STOLEN(String.valueOf("stolen")), + + SUSPECTEDFRAUD(String.valueOf("suspectedFraud")), + + TRANSACTIONRULE(String.valueOf("transactionRule")); + + private static final Logger LOG = Logger.getLogger(StatusReasonEnum.class.getName()); + + private String value; + + StatusReasonEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusReasonEnum fromValue(String value) { + for (StatusReasonEnum b : StatusReasonEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "StatusReasonEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(StatusReasonEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; + private StatusReasonEnum statusReason; + + /** The type of payment instrument. Possible values: **card**, **bankAccount**. */ + public enum TypeEnum { + BANKACCOUNT(String.valueOf("bankAccount")), + + CARD(String.valueOf("card")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public PaymentInstrument() {} + + /** + * Contains optional, additional business account details. Returned when you create a payment + * instrument with `type` **bankAccount**. + * + * @param additionalBankAccountIdentifications Contains optional, additional business account + * details. Returned when you create a payment instrument with `type` + * **bankAccount**. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + * @deprecated since Authorization webhooks v2 Please use `bankAccount` object instead + */ + @Deprecated // deprecated since Authorization webhooks v2: Please use `bankAccount` object instead + public PaymentInstrument additionalBankAccountIdentifications( + List + additionalBankAccountIdentifications) { + this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + return this; + } + + public PaymentInstrument addAdditionalBankAccountIdentificationsItem( + PaymentInstrumentAdditionalBankAccountIdentificationsInner + additionalBankAccountIdentificationsItem) { + if (this.additionalBankAccountIdentifications == null) { + this.additionalBankAccountIdentifications = new ArrayList<>(); + } + this.additionalBankAccountIdentifications.add(additionalBankAccountIdentificationsItem); + return this; + } + + /** + * Contains optional, additional business account details. Returned when you create a payment + * instrument with `type` **bankAccount**. + * + * @return additionalBankAccountIdentifications Contains optional, additional business account + * details. Returned when you create a payment instrument with `type` + * **bankAccount**. + * @deprecated // deprecated since Authorization webhooks v2: Please use `bankAccount` object + * instead + */ + @Deprecated // deprecated since Authorization webhooks v2: Please use `bankAccount` object instead + @JsonProperty(JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List + getAdditionalBankAccountIdentifications() { + return additionalBankAccountIdentifications; + } + + /** + * Contains optional, additional business account details. Returned when you create a payment + * instrument with `type` **bankAccount**. + * + * @param additionalBankAccountIdentifications Contains optional, additional business account + * details. Returned when you create a payment instrument with `type` + * **bankAccount**. + * @deprecated since Authorization webhooks v2 Please use `bankAccount` object instead + */ + @Deprecated // deprecated since Authorization webhooks v2: Please use `bankAccount` object instead + @JsonProperty(JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalBankAccountIdentifications( + List + additionalBankAccountIdentifications) { + this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + } + + /** + * The unique identifier of the [balance + * account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) + * associated with the payment instrument. + * + * @param balanceAccountId The unique identifier of the [balance + * account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) + * associated with the payment instrument. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument balanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + return this; + } + + /** + * The unique identifier of the [balance + * account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) + * associated with the payment instrument. + * + * @return balanceAccountId The unique identifier of the [balance + * account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) + * associated with 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](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) + * associated with the payment instrument. + * + * @param balanceAccountId The unique identifier of the [balance + * account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) + * associated with the payment instrument. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + } + + /** + * bankAccount + * + * @param bankAccount + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument bankAccount(BankAccountDetails bankAccount) { + this.bankAccount = bankAccount; + return this; + } + + /** + * Get bankAccount + * + * @return bankAccount + */ + @JsonProperty(JSON_PROPERTY_BANK_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BankAccountDetails getBankAccount() { + return bankAccount; + } + + /** + * bankAccount + * + * @param bankAccount + */ + @JsonProperty(JSON_PROPERTY_BANK_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankAccount(BankAccountDetails bankAccount) { + this.bankAccount = bankAccount; + } + + /** + * card + * + * @param card + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument card(Card card) { + this.card = card; + return this; + } + + /** + * Get card + * + * @return card + */ + @JsonProperty(JSON_PROPERTY_CARD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Card getCard() { + return card; + } + + /** + * card + * + * @param card + */ + @JsonProperty(JSON_PROPERTY_CARD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCard(Card card) { + this.card = card; + } + + /** + * Your description for the payment instrument, maximum 300 characters. + * + * @param description Your description for the payment instrument, maximum 300 characters. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument description(String description) { + this.description = description; + return this; + } + + /** + * Your description for the payment instrument, maximum 300 characters. + * + * @return description Your description for the payment instrument, maximum 300 characters. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * Your description for the payment instrument, maximum 300 characters. + * + * @param description Your description for the payment instrument, maximum 300 characters. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + /** + * The unique identifier of the payment instrument. + * + * @param id The unique identifier of the payment instrument. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the payment instrument. + * + * @return id The unique identifier of the payment instrument. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the payment instrument. + * + * @param id The unique identifier of the payment instrument. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + /** + * The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * country code where the payment instrument is issued. For example, **NL** or **US**. + * + * @param issuingCountryCode The two-character [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment + * instrument is issued. For example, **NL** or **US**. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument issuingCountryCode(String issuingCountryCode) { + this.issuingCountryCode = issuingCountryCode; + return this; + } + + /** + * The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * country code where the payment instrument is issued. For example, **NL** or **US**. + * + * @return issuingCountryCode The two-character [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment + * instrument is issued. For example, **NL** or **US**. + */ + @JsonProperty(JSON_PROPERTY_ISSUING_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssuingCountryCode() { + return issuingCountryCode; + } + + /** + * The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * country code where the payment instrument is issued. For example, **NL** or **US**. + * + * @param issuingCountryCode The two-character [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment + * instrument is issued. For example, **NL** or **US**. + */ + @JsonProperty(JSON_PROPERTY_ISSUING_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIssuingCountryCode(String issuingCountryCode) { + this.issuingCountryCode = issuingCountryCode; + } + + /** + * The unique identifier of the [payment instrument + * group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) + * to which the payment instrument belongs. + * + * @param paymentInstrumentGroupId The unique identifier of the [payment instrument + * group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) + * to which the payment instrument belongs. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument paymentInstrumentGroupId(String paymentInstrumentGroupId) { + this.paymentInstrumentGroupId = paymentInstrumentGroupId; + return this; + } + + /** + * The unique identifier of the [payment instrument + * group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) + * to which the payment instrument belongs. + * + * @return paymentInstrumentGroupId The unique identifier of the [payment instrument + * group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) + * to which the payment instrument belongs. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPaymentInstrumentGroupId() { + return paymentInstrumentGroupId; + } + + /** + * The unique identifier of the [payment instrument + * group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) + * to which the payment instrument belongs. + * + * @param paymentInstrumentGroupId The unique identifier of the [payment instrument + * group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) + * to which the payment instrument belongs. + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { + this.paymentInstrumentGroupId = paymentInstrumentGroupId; + } + + /** + * Your reference for the payment instrument, maximum 150 characters. + * + * @param reference Your reference for the payment instrument, maximum 150 characters. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument reference(String reference) { + this.reference = reference; + return this; + } + + /** + * Your reference for the payment instrument, maximum 150 characters. + * + * @return reference Your reference for the payment instrument, maximum 150 characters. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * Your reference for the payment instrument, maximum 150 characters. + * + * @param reference Your reference for the payment instrument, maximum 150 characters. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + } + + /** + * The unique identifier of the payment instrument that replaced this payment instrument. + * + * @param replacedById The unique identifier of the payment instrument that replaced this payment + * instrument. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument replacedById(String replacedById) { + this.replacedById = replacedById; + return this; + } + + /** + * The unique identifier of the payment instrument that replaced this payment instrument. + * + * @return replacedById The unique identifier of the payment instrument that replaced this payment + * instrument. + */ + @JsonProperty(JSON_PROPERTY_REPLACED_BY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReplacedById() { + return replacedById; + } + + /** + * The unique identifier of the payment instrument that replaced this payment instrument. + * + * @param replacedById The unique identifier of the payment instrument that replaced this payment + * instrument. + */ + @JsonProperty(JSON_PROPERTY_REPLACED_BY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplacedById(String replacedById) { + this.replacedById = replacedById; + } + + /** + * The unique identifier of the payment instrument that is replaced by this payment instrument. + * + * @param replacementOfId The unique identifier of the payment instrument that is replaced by this + * payment instrument. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument replacementOfId(String replacementOfId) { + this.replacementOfId = replacementOfId; + return this; + } + + /** + * The unique identifier of the payment instrument that is replaced by this payment instrument. + * + * @return replacementOfId The unique identifier of the payment instrument that is replaced by + * this payment instrument. + */ + @JsonProperty(JSON_PROPERTY_REPLACEMENT_OF_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReplacementOfId() { + return replacementOfId; + } + + /** + * The unique identifier of the payment instrument that is replaced by this payment instrument. + * + * @param replacementOfId The unique identifier of the payment instrument that is replaced by this + * payment instrument. + */ + @JsonProperty(JSON_PROPERTY_REPLACEMENT_OF_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReplacementOfId(String replacementOfId) { + this.replacementOfId = replacementOfId; + } + + /** + * The status of the payment instrument. If a status is not specified when creating a payment + * instrument, it is set to **active** by default. However, there can be exceptions for cards + * based on the `card.formFactor` and the `issuingCountryCode`. For example, + * when issuing physical cards in the US, the default status is **inactive**. Possible values: * + * **active**: The payment instrument is active and can be used to make payments. * **inactive**: + * The payment instrument is inactive and cannot be used to make payments. * **suspended**: The + * payment instrument is suspended, either because it was stolen or lost. * **closed**: The + * payment instrument is permanently closed. This action cannot be undone. + * + * @param status The status of the payment instrument. If a status is not specified when creating + * a payment instrument, it is set to **active** by default. However, there can be exceptions + * for cards based on the `card.formFactor` and the `issuingCountryCode`. + * For example, when issuing physical cards in the US, the default status is **inactive**. + * Possible values: * **active**: The payment instrument is active and can be used to make + * payments. * **inactive**: The payment instrument is inactive and cannot be used to make + * payments. * **suspended**: The payment instrument is suspended, either because it was + * stolen or lost. * **closed**: The payment instrument is permanently closed. This action + * cannot be undone. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the payment instrument. If a status is not specified when creating a payment + * instrument, it is set to **active** by default. However, there can be exceptions for cards + * based on the `card.formFactor` and the `issuingCountryCode`. For example, + * when issuing physical cards in the US, the default status is **inactive**. Possible values: * + * **active**: The payment instrument is active and can be used to make payments. * **inactive**: + * The payment instrument is inactive and cannot be used to make payments. * **suspended**: The + * payment instrument is suspended, either because it was stolen or lost. * **closed**: The + * payment instrument is permanently closed. This action cannot be undone. + * + * @return status The status of the payment instrument. If a status is not specified when creating + * a payment instrument, it is set to **active** by default. However, there can be exceptions + * for cards based on the `card.formFactor` and the `issuingCountryCode`. + * For example, when issuing physical cards in the US, the default status is **inactive**. + * Possible values: * **active**: The payment instrument is active and can be used to make + * payments. * **inactive**: The payment instrument is inactive and cannot be used to make + * payments. * **suspended**: The payment instrument is suspended, either because it was + * stolen or lost. * **closed**: The payment instrument is permanently closed. This action + * cannot be undone. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + /** + * The status of the payment instrument. If a status is not specified when creating a payment + * instrument, it is set to **active** by default. However, there can be exceptions for cards + * based on the `card.formFactor` and the `issuingCountryCode`. For example, + * when issuing physical cards in the US, the default status is **inactive**. Possible values: * + * **active**: The payment instrument is active and can be used to make payments. * **inactive**: + * The payment instrument is inactive and cannot be used to make payments. * **suspended**: The + * payment instrument is suspended, either because it was stolen or lost. * **closed**: The + * payment instrument is permanently closed. This action cannot be undone. + * + * @param status The status of the payment instrument. If a status is not specified when creating + * a payment instrument, it is set to **active** by default. However, there can be exceptions + * for cards based on the `card.formFactor` and the `issuingCountryCode`. + * For example, when issuing physical cards in the US, the default status is **inactive**. + * Possible values: * **active**: The payment instrument is active and can be used to make + * payments. * **inactive**: The payment instrument is inactive and cannot be used to make + * payments. * **suspended**: The payment instrument is suspended, either because it was + * stolen or lost. * **closed**: The payment instrument is permanently closed. This action + * cannot be undone. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * The status comment provides additional information for the statusReason of the payment + * instrument. + * + * @param statusComment The status comment provides additional information for the statusReason of + * the payment instrument. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument statusComment(String statusComment) { + this.statusComment = statusComment; + return this; + } + + /** + * The status comment provides additional information for the statusReason of the payment + * instrument. + * + * @return statusComment The status comment provides additional information for the statusReason + * of the payment instrument. + */ + @JsonProperty(JSON_PROPERTY_STATUS_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatusComment() { + return statusComment; + } + + /** + * The status comment provides additional information for the statusReason of the payment + * instrument. + * + * @param statusComment The status comment provides additional information for the statusReason of + * the payment instrument. + */ + @JsonProperty(JSON_PROPERTY_STATUS_COMMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusComment(String statusComment) { + this.statusComment = statusComment; + } + + /** + * The reason for the status of the payment instrument. Possible values: **accountClosure**, + * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, + * **transactionRule**, **other**. If the reason is **other**, you must also send the + * `statusComment` parameter describing the status change. + * + * @param statusReason The reason for the status of the payment instrument. Possible values: + * **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, + * **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must + * also send the `statusComment` parameter describing the status change. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument statusReason(StatusReasonEnum statusReason) { + this.statusReason = statusReason; + return this; + } + + /** + * The reason for the status of the payment instrument. Possible values: **accountClosure**, + * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, + * **transactionRule**, **other**. If the reason is **other**, you must also send the + * `statusComment` parameter describing the status change. + * + * @return statusReason The reason for the status of the payment instrument. Possible values: + * **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, + * **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must + * also send the `statusComment` parameter describing the status change. + */ + @JsonProperty(JSON_PROPERTY_STATUS_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusReasonEnum getStatusReason() { + return statusReason; + } + + /** + * The reason for the status of the payment instrument. Possible values: **accountClosure**, + * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, + * **transactionRule**, **other**. If the reason is **other**, you must also send the + * `statusComment` parameter describing the status change. + * + * @param statusReason The reason for the status of the payment instrument. Possible values: + * **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, + * **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must + * also send the `statusComment` parameter describing the status change. + */ + @JsonProperty(JSON_PROPERTY_STATUS_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusReason(StatusReasonEnum statusReason) { + this.statusReason = statusReason; + } + + /** + * The type of payment instrument. Possible values: **card**, **bankAccount**. + * + * @param type The type of payment instrument. Possible values: **card**, **bankAccount**. + * @return the current {@code PaymentInstrument} instance, allowing for method chaining + */ + public PaymentInstrument type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of payment instrument. Possible values: **card**, **bankAccount**. + * + * @return type The type of payment instrument. Possible values: **card**, **bankAccount**. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * The type of payment instrument. Possible values: **card**, **bankAccount**. + * + * @param type The type of payment instrument. Possible values: **card**, **bankAccount**. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + /** Return true if this PaymentInstrument object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentInstrument paymentInstrument = (PaymentInstrument) o; + return Objects.equals( + this.additionalBankAccountIdentifications, + paymentInstrument.additionalBankAccountIdentifications) + && Objects.equals(this.balanceAccountId, paymentInstrument.balanceAccountId) + && Objects.equals(this.bankAccount, paymentInstrument.bankAccount) + && Objects.equals(this.card, paymentInstrument.card) + && Objects.equals(this.description, paymentInstrument.description) + && Objects.equals(this.id, paymentInstrument.id) + && Objects.equals(this.issuingCountryCode, paymentInstrument.issuingCountryCode) + && Objects.equals(this.paymentInstrumentGroupId, paymentInstrument.paymentInstrumentGroupId) + && Objects.equals(this.reference, paymentInstrument.reference) + && Objects.equals(this.replacedById, paymentInstrument.replacedById) + && Objects.equals(this.replacementOfId, paymentInstrument.replacementOfId) + && Objects.equals(this.status, paymentInstrument.status) + && Objects.equals(this.statusComment, paymentInstrument.statusComment) + && Objects.equals(this.statusReason, paymentInstrument.statusReason) + && Objects.equals(this.type, paymentInstrument.type); + } + + @Override + public int hashCode() { + return Objects.hash( + additionalBankAccountIdentifications, + balanceAccountId, + bankAccount, + card, + description, + id, + issuingCountryCode, + paymentInstrumentGroupId, + reference, + replacedById, + replacementOfId, + status, + statusComment, + statusReason, + type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentInstrument {\n"); + sb.append(" additionalBankAccountIdentifications: ") + .append(toIndentedString(additionalBankAccountIdentifications)) + .append("\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" bankAccount: ").append(toIndentedString(bankAccount)).append("\n"); + sb.append(" card: ").append(toIndentedString(card)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" issuingCountryCode: ").append(toIndentedString(issuingCountryCode)).append("\n"); + sb.append(" paymentInstrumentGroupId: ") + .append(toIndentedString(paymentInstrumentGroupId)) + .append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" replacedById: ").append(toIndentedString(replacedById)).append("\n"); + sb.append(" replacementOfId: ").append(toIndentedString(replacementOfId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" statusComment: ").append(toIndentedString(statusComment)).append("\n"); + sb.append(" statusReason: ").append(toIndentedString(statusReason)).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 "); + } + + /** + * Create an instance of PaymentInstrument given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentInstrument + * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentInstrument + */ + public static PaymentInstrument fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentInstrument.class); + } + + /** + * Convert an instance of PaymentInstrument 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/relayedauthorizationwebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.java new file mode 100644 index 000000000..09926c337 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/PaymentInstrumentAdditionalBankAccountIdentificationsInner.java @@ -0,0 +1,223 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.logging.Level; +import java.util.logging.Logger; + +@JsonDeserialize( + using = + PaymentInstrumentAdditionalBankAccountIdentificationsInner + .PaymentInstrumentAdditionalBankAccountIdentificationsInnerDeserializer.class) +@JsonSerialize( + using = + PaymentInstrumentAdditionalBankAccountIdentificationsInner + .PaymentInstrumentAdditionalBankAccountIdentificationsInnerSerializer.class) +public class PaymentInstrumentAdditionalBankAccountIdentificationsInner + extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(PaymentInstrumentAdditionalBankAccountIdentificationsInner.class.getName()); + + public static class PaymentInstrumentAdditionalBankAccountIdentificationsInnerSerializer + extends StdSerializer { + public PaymentInstrumentAdditionalBankAccountIdentificationsInnerSerializer( + Class t) { + super(t); + } + + public PaymentInstrumentAdditionalBankAccountIdentificationsInnerSerializer() { + this(null); + } + + @Override + public void serialize( + PaymentInstrumentAdditionalBankAccountIdentificationsInner value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class PaymentInstrumentAdditionalBankAccountIdentificationsInnerDeserializer + extends StdDeserializer { + public PaymentInstrumentAdditionalBankAccountIdentificationsInnerDeserializer() { + this(PaymentInstrumentAdditionalBankAccountIdentificationsInner.class); + } + + public PaymentInstrumentAdditionalBankAccountIdentificationsInnerDeserializer(Class vc) { + super(vc); + } + + @Override + public PaymentInstrumentAdditionalBankAccountIdentificationsInner deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize IbanAccountIdentification + try { + boolean attemptParsing = true; + if (attemptParsing) { + // Checks if the unique type of the oneOf json matches any of the object TypeEnum values + boolean typeMatch = false; + if (tree.findValue("type") != null) { + typeMatch = + Arrays.stream(IbanAccountIdentification.TypeEnum.values()) + .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText())); + } + + if (typeMatch) { + deserialized = + tree.traverse(jp.getCodec()).readValueAs(IbanAccountIdentification.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'IbanAccountIdentification'"); + } + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IbanAccountIdentification'", e); + } + + if (match == 1) { + PaymentInstrumentAdditionalBankAccountIdentificationsInner ret = + new PaymentInstrumentAdditionalBankAccountIdentificationsInner(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException( + String.format( + "Failed deserialization for PaymentInstrumentAdditionalBankAccountIdentificationsInner: %d classes match result, expected 1", + match)); + } + + /** Handle deserialization of the 'null' value. */ + @Override + public PaymentInstrumentAdditionalBankAccountIdentificationsInner getNullValue( + DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), + "PaymentInstrumentAdditionalBankAccountIdentificationsInner cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public PaymentInstrumentAdditionalBankAccountIdentificationsInner() { + super("oneOf", Boolean.FALSE); + } + + public PaymentInstrumentAdditionalBankAccountIdentificationsInner(IbanAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IbanAccountIdentification", new GenericType() {}); + JSON.registerDescendants( + PaymentInstrumentAdditionalBankAccountIdentificationsInner.class, + Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return PaymentInstrumentAdditionalBankAccountIdentificationsInner.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: IbanAccountIdentification + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(IbanAccountIdentification.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be IbanAccountIdentification"); + } + + /** + * Get the actual instance, which can be the following: IbanAccountIdentification + * + * @return The actual instance (IbanAccountIdentification) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IbanAccountIdentification`. If the actual instance is not + * `IbanAccountIdentification`, the ClassCastException will be thrown. + * + * @return The actual instance of `IbanAccountIdentification` + * @throws ClassCastException if the instance is not `IbanAccountIdentification` + */ + public IbanAccountIdentification getIbanAccountIdentification() throws ClassCastException { + return (IbanAccountIdentification) super.getActualInstance(); + } + + /** + * Create an instance of PaymentInstrumentAdditionalBankAccountIdentificationsInner given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of PaymentInstrumentAdditionalBankAccountIdentificationsInner + * @throws IOException if the JSON string is invalid with respect to + * PaymentInstrumentAdditionalBankAccountIdentificationsInner + */ + public static PaymentInstrumentAdditionalBankAccountIdentificationsInner fromJson( + String jsonString) throws IOException { + return JSON.getMapper() + .readValue(jsonString, PaymentInstrumentAdditionalBankAccountIdentificationsInner.class); + } + + /** + * Convert an instance of PaymentInstrumentAdditionalBankAccountIdentificationsInner 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/relayedauthorizationwebhooks/Phone.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Phone.java new file mode 100644 index 000000000..d079e12b4 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/Phone.java @@ -0,0 +1,208 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** Phone */ +@JsonPropertyOrder({Phone.JSON_PROPERTY_NUMBER, Phone.JSON_PROPERTY_TYPE}) +public class Phone { + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + /** Type of phone number. Possible values: **Landline**, **Mobile**. */ + public enum TypeEnum { + LANDLINE(String.valueOf("landline")), + + MOBILE(String.valueOf("mobile")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public Phone() {} + + /** + * The full phone number provided as a single string. For example, **\"0031 6 11 22 33 + * 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + * + * @param number The full phone number provided as a single string. For example, **\"0031 6 + * 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) + * 611223344\"**. + * @return the current {@code Phone} instance, allowing for method chaining + */ + public Phone number(String number) { + this.number = number; + return this; + } + + /** + * The full phone number provided as a single string. For example, **\"0031 6 11 22 33 + * 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + * + * @return number The full phone number provided as a single string. For example, **\"0031 6 + * 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) + * 611223344\"**. + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNumber() { + return number; + } + + /** + * The full phone number provided as a single string. For example, **\"0031 6 11 22 33 + * 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + * + * @param number The full phone number provided as a single string. For example, **\"0031 6 + * 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) + * 611223344\"**. + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; + } + + /** + * Type of phone number. Possible values: **Landline**, **Mobile**. + * + * @param type Type of phone number. Possible values: **Landline**, **Mobile**. + * @return the current {@code Phone} instance, allowing for method chaining + */ + public Phone type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Type of phone number. Possible values: **Landline**, **Mobile**. + * + * @return type Type of phone number. Possible values: **Landline**, **Mobile**. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * Type of phone number. Possible values: **Landline**, **Mobile**. + * + * @param type Type of phone number. Possible values: **Landline**, **Mobile**. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + /** Return true if this Phone object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Phone phone = (Phone) o; + return Objects.equals(this.number, phone.number) && Objects.equals(this.type, phone.type); + } + + @Override + public int hashCode() { + return Objects.hash(number, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Phone {\n"); + sb.append(" number: ").append(toIndentedString(number)).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 "); + } + + /** + * Create an instance of Phone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Phone + * @throws JsonProcessingException if the JSON string is invalid with respect to Phone + */ + public static Phone fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Phone.class); + } + + /** + * Convert an instance of Phone 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/relayedauthorizationwebhooks/RelayedAuthorisationRequest.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/RelayedAuthorisationRequest.java new file mode 100644 index 000000000..2f98b1b44 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/RelayedAuthorisationRequest.java @@ -0,0 +1,1206 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** RelayedAuthorisationRequest */ +@JsonPropertyOrder({ + RelayedAuthorisationRequest.JSON_PROPERTY_ACCOUNT_HOLDER, + RelayedAuthorisationRequest.JSON_PROPERTY_AMOUNT, + RelayedAuthorisationRequest.JSON_PROPERTY_AMOUNT_ADJUSTMENTS, + RelayedAuthorisationRequest.JSON_PROPERTY_AUTH_CODE, + RelayedAuthorisationRequest.JSON_PROPERTY_AUTHORISATION_DECISION, + RelayedAuthorisationRequest.JSON_PROPERTY_AUTHORISATION_TYPE, + RelayedAuthorisationRequest.JSON_PROPERTY_BALANCE_ACCOUNT, + RelayedAuthorisationRequest.JSON_PROPERTY_BALANCE_MUTATIONS, + RelayedAuthorisationRequest.JSON_PROPERTY_BALANCE_PLATFORM, + RelayedAuthorisationRequest.JSON_PROPERTY_ENTRY_MODE, + RelayedAuthorisationRequest.JSON_PROPERTY_ENVIRONMENT, + RelayedAuthorisationRequest.JSON_PROPERTY_ID, + RelayedAuthorisationRequest.JSON_PROPERTY_MERCHANT_DATA, + RelayedAuthorisationRequest.JSON_PROPERTY_ORIGINAL_AMOUNT, + RelayedAuthorisationRequest.JSON_PROPERTY_PAYMENT_INSTRUMENT, + RelayedAuthorisationRequest.JSON_PROPERTY_PROCESSING_TYPE, + RelayedAuthorisationRequest.JSON_PROPERTY_REFERENCE, + RelayedAuthorisationRequest.JSON_PROPERTY_SCHEME_RISK_SCORE, + RelayedAuthorisationRequest.JSON_PROPERTY_SCHEME_TRACE_ID, + RelayedAuthorisationRequest.JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID, + RelayedAuthorisationRequest.JSON_PROPERTY_SCORES, + RelayedAuthorisationRequest.JSON_PROPERTY_THREE_D_SECURE, + RelayedAuthorisationRequest.JSON_PROPERTY_TRANSACTION_RULES_RESULT, + RelayedAuthorisationRequest.JSON_PROPERTY_TYPE, + RelayedAuthorisationRequest.JSON_PROPERTY_VALIDATION_RESULT +}) +public class RelayedAuthorisationRequest { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; + private ResourceReference accountHolder; + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENTS = "amountAdjustments"; + private List amountAdjustments; + + public static final String JSON_PROPERTY_AUTH_CODE = "authCode"; + private String authCode; + + public static final String JSON_PROPERTY_AUTHORISATION_DECISION = "authorisationDecision"; + private AuthorisationDecisionRequest authorisationDecision; + + public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; + private String authorisationType; + + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; + private ResourceReference balanceAccount; + + public static final String JSON_PROPERTY_BALANCE_MUTATIONS = "balanceMutations"; + private List balanceMutations; + + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; + private String balancePlatform; + + public static final String JSON_PROPERTY_ENTRY_MODE = "entryMode"; + private String entryMode; + + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; + private String environment; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_MERCHANT_DATA = "merchantData"; + private MerchantData merchantData; + + public static final String JSON_PROPERTY_ORIGINAL_AMOUNT = "originalAmount"; + private Amount originalAmount; + + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; + private PaymentInstrument paymentInstrument; + + public static final String JSON_PROPERTY_PROCESSING_TYPE = "processingType"; + private String processingType; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + public static final String JSON_PROPERTY_SCHEME_RISK_SCORE = "schemeRiskScore"; + private Integer schemeRiskScore; + + public static final String JSON_PROPERTY_SCHEME_TRACE_ID = "schemeTraceId"; + private String schemeTraceId; + + public static final String JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID = + "schemeUniqueTransactionId"; + private String schemeUniqueTransactionId; + + public static final String JSON_PROPERTY_SCORES = "scores"; + private List scores; + + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; + private ThreeDSecure threeDSecure; + + public static final String JSON_PROPERTY_TRANSACTION_RULES_RESULT = "transactionRulesResult"; + private TransactionRulesResult transactionRulesResult; + + /** Type of notification. */ + public enum TypeEnum { + BALANCEPLATFORM_AUTHORISATION_RELAYED(String.valueOf("balancePlatform.authorisation.relayed")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_VALIDATION_RESULT = "validationResult"; + private List validationResult; + + public RelayedAuthorisationRequest() {} + + /** + * accountHolder + * + * @param accountHolder + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest accountHolder(ResourceReference accountHolder) { + this.accountHolder = accountHolder; + return this; + } + + /** + * Get accountHolder + * + * @return accountHolder + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResourceReference getAccountHolder() { + return accountHolder; + } + + /** + * accountHolder + * + * @param accountHolder + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolder(ResourceReference accountHolder) { + this.accountHolder = accountHolder; + } + + /** + * amount + * + * @param amount + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest amount(Amount amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + } + + /** + * The amount adjustments in the transaction. + * + * @param amountAdjustments The amount adjustments in the transaction. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest amountAdjustments(List amountAdjustments) { + this.amountAdjustments = amountAdjustments; + return this; + } + + public RelayedAuthorisationRequest addAmountAdjustmentsItem( + AmountAdjustment amountAdjustmentsItem) { + if (this.amountAdjustments == null) { + this.amountAdjustments = new ArrayList<>(); + } + this.amountAdjustments.add(amountAdjustmentsItem); + return this; + } + + /** + * The amount adjustments in the transaction. + * + * @return amountAdjustments The amount adjustments in the transaction. + */ + @JsonProperty(JSON_PROPERTY_AMOUNT_ADJUSTMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAmountAdjustments() { + return amountAdjustments; + } + + /** + * The amount adjustments in the transaction. + * + * @param amountAdjustments The amount adjustments in the transaction. + */ + @JsonProperty(JSON_PROPERTY_AMOUNT_ADJUSTMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmountAdjustments(List amountAdjustments) { + this.amountAdjustments = amountAdjustments; + } + + /** + * The authorization code for the payment. + * + * @param authCode The authorization code for the payment. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest authCode(String authCode) { + this.authCode = authCode; + return this; + } + + /** + * The authorization code for the payment. + * + * @return authCode The authorization code for the payment. + */ + @JsonProperty(JSON_PROPERTY_AUTH_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthCode() { + return authCode; + } + + /** + * The authorization code for the payment. + * + * @param authCode The authorization code for the payment. + */ + @JsonProperty(JSON_PROPERTY_AUTH_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthCode(String authCode) { + this.authCode = authCode; + } + + /** + * authorisationDecision + * + * @param authorisationDecision + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest authorisationDecision( + AuthorisationDecisionRequest authorisationDecision) { + this.authorisationDecision = authorisationDecision; + return this; + } + + /** + * Get authorisationDecision + * + * @return authorisationDecision + */ + @JsonProperty(JSON_PROPERTY_AUTHORISATION_DECISION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AuthorisationDecisionRequest getAuthorisationDecision() { + return authorisationDecision; + } + + /** + * authorisationDecision + * + * @param authorisationDecision + */ + @JsonProperty(JSON_PROPERTY_AUTHORISATION_DECISION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthorisationDecision(AuthorisationDecisionRequest authorisationDecision) { + this.authorisationDecision = authorisationDecision; + } + + /** + * The authorization type. Possible values: * **finalAuthorisation** * **preAuthorisation** * + * **defaultAuthorisation** + * + * @param authorisationType The authorization type. Possible values: * **finalAuthorisation** * + * **preAuthorisation** * **defaultAuthorisation** + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest authorisationType(String authorisationType) { + this.authorisationType = authorisationType; + return this; + } + + /** + * The authorization type. Possible values: * **finalAuthorisation** * **preAuthorisation** * + * **defaultAuthorisation** + * + * @return authorisationType The authorization type. Possible values: * **finalAuthorisation** * + * **preAuthorisation** * **defaultAuthorisation** + */ + @JsonProperty(JSON_PROPERTY_AUTHORISATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthorisationType() { + return authorisationType; + } + + /** + * The authorization type. Possible values: * **finalAuthorisation** * **preAuthorisation** * + * **defaultAuthorisation** + * + * @param authorisationType The authorization type. Possible values: * **finalAuthorisation** * + * **preAuthorisation** * **defaultAuthorisation** + */ + @JsonProperty(JSON_PROPERTY_AUTHORISATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthorisationType(String authorisationType) { + this.authorisationType = authorisationType; + } + + /** + * balanceAccount + * + * @param balanceAccount + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest balanceAccount(ResourceReference balanceAccount) { + this.balanceAccount = balanceAccount; + return this; + } + + /** + * Get balanceAccount + * + * @return balanceAccount + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResourceReference getBalanceAccount() { + return balanceAccount; + } + + /** + * balanceAccount + * + * @param balanceAccount + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAccount(ResourceReference balanceAccount) { + this.balanceAccount = balanceAccount; + } + + /** + * The list of balance mutations per event. + * + * @param balanceMutations The list of balance mutations per event. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest balanceMutations(List balanceMutations) { + this.balanceMutations = balanceMutations; + return this; + } + + public RelayedAuthorisationRequest addBalanceMutationsItem(BalanceMutation balanceMutationsItem) { + if (this.balanceMutations == null) { + this.balanceMutations = new ArrayList<>(); + } + this.balanceMutations.add(balanceMutationsItem); + return this; + } + + /** + * The list of balance mutations per event. + * + * @return balanceMutations The list of balance mutations per event. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_MUTATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBalanceMutations() { + return balanceMutations; + } + + /** + * The list of balance mutations per event. + * + * @param balanceMutations The list of balance mutations per event. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_MUTATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceMutations(List balanceMutations) { + this.balanceMutations = balanceMutations; + } + + /** + * The unique identifier of the balance platform. + * + * @param balancePlatform The unique identifier of the balance platform. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest balancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * + * @return balancePlatform The unique identifier of the balance platform. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBalancePlatform() { + return balancePlatform; + } + + /** + * The unique identifier of the balance platform. + * + * @param balancePlatform The unique identifier of the balance platform. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + /** + * The entry mode of the information of the payment instrument. For example: **contactless**, + * **chip**, **magstripe**. + * + * @param entryMode The entry mode of the information of the payment instrument. For example: + * **contactless**, **chip**, **magstripe**. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest entryMode(String entryMode) { + this.entryMode = entryMode; + return this; + } + + /** + * The entry mode of the information of the payment instrument. For example: **contactless**, + * **chip**, **magstripe**. + * + * @return entryMode The entry mode of the information of the payment instrument. For example: + * **contactless**, **chip**, **magstripe**. + */ + @JsonProperty(JSON_PROPERTY_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEntryMode() { + return entryMode; + } + + /** + * The entry mode of the information of the payment instrument. For example: **contactless**, + * **chip**, **magstripe**. + * + * @param entryMode The entry mode of the information of the payment instrument. For example: + * **contactless**, **chip**, **magstripe**. + */ + @JsonProperty(JSON_PROPERTY_ENTRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEntryMode(String entryMode) { + this.entryMode = entryMode; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @param environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest environment(String environment) { + this.environment = environment; + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + */ + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnvironment() { + return environment; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @param environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + */ + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnvironment(String environment) { + this.environment = environment; + } + + /** + * The unique identifier of the transfer. + * + * @param id The unique identifier of the transfer. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the transfer. + * + * @return id The unique identifier of the transfer. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the transfer. + * + * @param id The unique identifier of the transfer. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + /** + * merchantData + * + * @param merchantData + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest merchantData(MerchantData merchantData) { + this.merchantData = merchantData; + return this; + } + + /** + * Get merchantData + * + * @return merchantData + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MerchantData getMerchantData() { + return merchantData; + } + + /** + * merchantData + * + * @param merchantData + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantData(MerchantData merchantData) { + this.merchantData = merchantData; + } + + /** + * originalAmount + * + * @param originalAmount + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest originalAmount(Amount originalAmount) { + this.originalAmount = originalAmount; + return this; + } + + /** + * Get originalAmount + * + * @return originalAmount + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getOriginalAmount() { + return originalAmount; + } + + /** + * originalAmount + * + * @param originalAmount + */ + @JsonProperty(JSON_PROPERTY_ORIGINAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalAmount(Amount originalAmount) { + this.originalAmount = originalAmount; + } + + /** + * paymentInstrument + * + * @param paymentInstrument + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest paymentInstrument(PaymentInstrument paymentInstrument) { + this.paymentInstrument = paymentInstrument; + return this; + } + + /** + * Get paymentInstrument + * + * @return paymentInstrument + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaymentInstrument getPaymentInstrument() { + return paymentInstrument; + } + + /** + * paymentInstrument + * + * @param paymentInstrument + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrument(PaymentInstrument paymentInstrument) { + this.paymentInstrument = paymentInstrument; + } + + /** + * The processing type used for this payment. For example: **ecommerce**, **pos**, **moto**. + * + * @param processingType The processing type used for this payment. For example: **ecommerce**, + * **pos**, **moto**. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest processingType(String processingType) { + this.processingType = processingType; + return this; + } + + /** + * The processing type used for this payment. For example: **ecommerce**, **pos**, **moto**. + * + * @return processingType The processing type used for this payment. For example: **ecommerce**, + * **pos**, **moto**. + */ + @JsonProperty(JSON_PROPERTY_PROCESSING_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProcessingType() { + return processingType; + } + + /** + * The processing type used for this payment. For example: **ecommerce**, **pos**, **moto**. + * + * @param processingType The processing type used for this payment. For example: **ecommerce**, + * **pos**, **moto**. + */ + @JsonProperty(JSON_PROPERTY_PROCESSING_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProcessingType(String processingType) { + this.processingType = processingType; + } + + /** + * The reference of the payment. + * + * @param reference The reference of the payment. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest reference(String reference) { + this.reference = reference; + return this; + } + + /** + * The reference of the payment. + * + * @return reference The reference of the payment. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * The reference of the payment. + * + * @param reference The reference of the payment. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + } + + /** + * The risk score provided by the card schemes. + * + * @param schemeRiskScore The risk score provided by the card schemes. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest schemeRiskScore(Integer schemeRiskScore) { + this.schemeRiskScore = schemeRiskScore; + return this; + } + + /** + * The risk score provided by the card schemes. + * + * @return schemeRiskScore The risk score provided by the card schemes. + */ + @JsonProperty(JSON_PROPERTY_SCHEME_RISK_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSchemeRiskScore() { + return schemeRiskScore; + } + + /** + * The risk score provided by the card schemes. + * + * @param schemeRiskScore The risk score provided by the card schemes. + */ + @JsonProperty(JSON_PROPERTY_SCHEME_RISK_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchemeRiskScore(Integer schemeRiskScore) { + this.schemeRiskScore = schemeRiskScore; + } + + /** + * The identifier of the original payment. This ID is provided by the scheme and can be + * alphanumeric or numeric, depending on the scheme. + * + * @param schemeTraceId The identifier of the original payment. This ID is provided by the scheme + * and can be alphanumeric or numeric, depending on the scheme. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest schemeTraceId(String schemeTraceId) { + this.schemeTraceId = schemeTraceId; + return this; + } + + /** + * The identifier of the original payment. This ID is provided by the scheme and can be + * alphanumeric or numeric, depending on the scheme. + * + * @return schemeTraceId The identifier of the original payment. This ID is provided by the scheme + * and can be alphanumeric or numeric, depending on the scheme. + */ + @JsonProperty(JSON_PROPERTY_SCHEME_TRACE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSchemeTraceId() { + return schemeTraceId; + } + + /** + * The identifier of the original payment. This ID is provided by the scheme and can be + * alphanumeric or numeric, depending on the scheme. + * + * @param schemeTraceId The identifier of the original payment. This ID is provided by the scheme + * and can be alphanumeric or numeric, depending on the scheme. + */ + @JsonProperty(JSON_PROPERTY_SCHEME_TRACE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchemeTraceId(String schemeTraceId) { + this.schemeTraceId = schemeTraceId; + } + + /** + * The unique identifier created by the scheme. This ID can be alphanumeric or numeric depending + * on the scheme. + * + * @param schemeUniqueTransactionId The unique identifier created by the scheme. This ID can be + * alphanumeric or numeric depending on the scheme. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest schemeUniqueTransactionId(String schemeUniqueTransactionId) { + this.schemeUniqueTransactionId = schemeUniqueTransactionId; + return this; + } + + /** + * The unique identifier created by the scheme. This ID can be alphanumeric or numeric depending + * on the scheme. + * + * @return schemeUniqueTransactionId The unique identifier created by the scheme. This ID can be + * alphanumeric or numeric depending on the scheme. + */ + @JsonProperty(JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSchemeUniqueTransactionId() { + return schemeUniqueTransactionId; + } + + /** + * The unique identifier created by the scheme. This ID can be alphanumeric or numeric depending + * on the scheme. + * + * @param schemeUniqueTransactionId The unique identifier created by the scheme. This ID can be + * alphanumeric or numeric depending on the scheme. + */ + @JsonProperty(JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { + this.schemeUniqueTransactionId = schemeUniqueTransactionId; + } + + /** + * The list of transaction scores. + * + * @param scores The list of transaction scores. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest scores(List scores) { + this.scores = scores; + return this; + } + + public RelayedAuthorisationRequest addScoresItem(TransactionScoring scoresItem) { + if (this.scores == null) { + this.scores = new ArrayList<>(); + } + this.scores.add(scoresItem); + return this; + } + + /** + * The list of transaction scores. + * + * @return scores The list of transaction scores. + */ + @JsonProperty(JSON_PROPERTY_SCORES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getScores() { + return scores; + } + + /** + * The list of transaction scores. + * + * @param scores The list of transaction scores. + */ + @JsonProperty(JSON_PROPERTY_SCORES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScores(List scores) { + this.scores = scores; + } + + /** + * threeDSecure + * + * @param threeDSecure + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest threeDSecure(ThreeDSecure threeDSecure) { + this.threeDSecure = threeDSecure; + return this; + } + + /** + * Get threeDSecure + * + * @return threeDSecure + */ + @JsonProperty(JSON_PROPERTY_THREE_D_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ThreeDSecure getThreeDSecure() { + return threeDSecure; + } + + /** + * threeDSecure + * + * @param threeDSecure + */ + @JsonProperty(JSON_PROPERTY_THREE_D_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeDSecure(ThreeDSecure threeDSecure) { + this.threeDSecure = threeDSecure; + } + + /** + * transactionRulesResult + * + * @param transactionRulesResult + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest transactionRulesResult( + TransactionRulesResult transactionRulesResult) { + this.transactionRulesResult = transactionRulesResult; + return this; + } + + /** + * Get transactionRulesResult + * + * @return transactionRulesResult + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_RULES_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionRulesResult getTransactionRulesResult() { + return transactionRulesResult; + } + + /** + * transactionRulesResult + * + * @param transactionRulesResult + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_RULES_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionRulesResult(TransactionRulesResult transactionRulesResult) { + this.transactionRulesResult = transactionRulesResult; + } + + /** + * Type of notification. + * + * @param type Type of notification. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Type of notification. + * + * @return type Type of notification. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * Type of notification. + * + * @param type Type of notification. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + /** + * Contains the checks that Adyen performed to validate the payment and the result of each. + * + * @param validationResult Contains the checks that Adyen performed to validate the payment and + * the result of each. + * @return the current {@code RelayedAuthorisationRequest} instance, allowing for method chaining + */ + public RelayedAuthorisationRequest validationResult(List validationResult) { + this.validationResult = validationResult; + return this; + } + + public RelayedAuthorisationRequest addValidationResultItem( + ValidationResult validationResultItem) { + if (this.validationResult == null) { + this.validationResult = new ArrayList<>(); + } + this.validationResult.add(validationResultItem); + return this; + } + + /** + * Contains the checks that Adyen performed to validate the payment and the result of each. + * + * @return validationResult Contains the checks that Adyen performed to validate the payment and + * the result of each. + */ + @JsonProperty(JSON_PROPERTY_VALIDATION_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValidationResult() { + return validationResult; + } + + /** + * Contains the checks that Adyen performed to validate the payment and the result of each. + * + * @param validationResult Contains the checks that Adyen performed to validate the payment and + * the result of each. + */ + @JsonProperty(JSON_PROPERTY_VALIDATION_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationResult(List validationResult) { + this.validationResult = validationResult; + } + + /** Return true if this RelayedAuthorisationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelayedAuthorisationRequest relayedAuthorisationRequest = (RelayedAuthorisationRequest) o; + return Objects.equals(this.accountHolder, relayedAuthorisationRequest.accountHolder) + && Objects.equals(this.amount, relayedAuthorisationRequest.amount) + && Objects.equals(this.amountAdjustments, relayedAuthorisationRequest.amountAdjustments) + && Objects.equals(this.authCode, relayedAuthorisationRequest.authCode) + && Objects.equals( + this.authorisationDecision, relayedAuthorisationRequest.authorisationDecision) + && Objects.equals(this.authorisationType, relayedAuthorisationRequest.authorisationType) + && Objects.equals(this.balanceAccount, relayedAuthorisationRequest.balanceAccount) + && Objects.equals(this.balanceMutations, relayedAuthorisationRequest.balanceMutations) + && Objects.equals(this.balancePlatform, relayedAuthorisationRequest.balancePlatform) + && Objects.equals(this.entryMode, relayedAuthorisationRequest.entryMode) + && Objects.equals(this.environment, relayedAuthorisationRequest.environment) + && Objects.equals(this.id, relayedAuthorisationRequest.id) + && Objects.equals(this.merchantData, relayedAuthorisationRequest.merchantData) + && Objects.equals(this.originalAmount, relayedAuthorisationRequest.originalAmount) + && Objects.equals(this.paymentInstrument, relayedAuthorisationRequest.paymentInstrument) + && Objects.equals(this.processingType, relayedAuthorisationRequest.processingType) + && Objects.equals(this.reference, relayedAuthorisationRequest.reference) + && Objects.equals(this.schemeRiskScore, relayedAuthorisationRequest.schemeRiskScore) + && Objects.equals(this.schemeTraceId, relayedAuthorisationRequest.schemeTraceId) + && Objects.equals( + this.schemeUniqueTransactionId, relayedAuthorisationRequest.schemeUniqueTransactionId) + && Objects.equals(this.scores, relayedAuthorisationRequest.scores) + && Objects.equals(this.threeDSecure, relayedAuthorisationRequest.threeDSecure) + && Objects.equals( + this.transactionRulesResult, relayedAuthorisationRequest.transactionRulesResult) + && Objects.equals(this.type, relayedAuthorisationRequest.type) + && Objects.equals(this.validationResult, relayedAuthorisationRequest.validationResult); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolder, + amount, + amountAdjustments, + authCode, + authorisationDecision, + authorisationType, + balanceAccount, + balanceMutations, + balancePlatform, + entryMode, + environment, + id, + merchantData, + originalAmount, + paymentInstrument, + processingType, + reference, + schemeRiskScore, + schemeTraceId, + schemeUniqueTransactionId, + scores, + threeDSecure, + transactionRulesResult, + type, + validationResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelayedAuthorisationRequest {\n"); + sb.append(" accountHolder: ").append(toIndentedString(accountHolder)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" amountAdjustments: ").append(toIndentedString(amountAdjustments)).append("\n"); + sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); + sb.append(" authorisationDecision: ") + .append(toIndentedString(authorisationDecision)) + .append("\n"); + sb.append(" authorisationType: ").append(toIndentedString(authorisationType)).append("\n"); + sb.append(" balanceAccount: ").append(toIndentedString(balanceAccount)).append("\n"); + sb.append(" balanceMutations: ").append(toIndentedString(balanceMutations)).append("\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" entryMode: ").append(toIndentedString(entryMode)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" merchantData: ").append(toIndentedString(merchantData)).append("\n"); + sb.append(" originalAmount: ").append(toIndentedString(originalAmount)).append("\n"); + sb.append(" paymentInstrument: ").append(toIndentedString(paymentInstrument)).append("\n"); + sb.append(" processingType: ").append(toIndentedString(processingType)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" schemeRiskScore: ").append(toIndentedString(schemeRiskScore)).append("\n"); + sb.append(" schemeTraceId: ").append(toIndentedString(schemeTraceId)).append("\n"); + sb.append(" schemeUniqueTransactionId: ") + .append(toIndentedString(schemeUniqueTransactionId)) + .append("\n"); + sb.append(" scores: ").append(toIndentedString(scores)).append("\n"); + sb.append(" threeDSecure: ").append(toIndentedString(threeDSecure)).append("\n"); + sb.append(" transactionRulesResult: ") + .append(toIndentedString(transactionRulesResult)) + .append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" validationResult: ").append(toIndentedString(validationResult)).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 "); + } + + /** + * Create an instance of RelayedAuthorisationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RelayedAuthorisationRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * RelayedAuthorisationRequest + */ + public static RelayedAuthorisationRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, RelayedAuthorisationRequest.class); + } + + /** + * Convert an instance of RelayedAuthorisationRequest 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/relayedauthorizationwebhooks/RelayedAuthorisationResponse.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/RelayedAuthorisationResponse.java new file mode 100644 index 000000000..d4a16dea2 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/RelayedAuthorisationResponse.java @@ -0,0 +1,219 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.HashMap; +import java.util.Map; + +/** RelayedAuthorisationResponse */ +@JsonPropertyOrder({ + RelayedAuthorisationResponse.JSON_PROPERTY_AUTHORISATION_DECISION, + RelayedAuthorisationResponse.JSON_PROPERTY_METADATA, + RelayedAuthorisationResponse.JSON_PROPERTY_REFERENCE +}) +public class RelayedAuthorisationResponse { + public static final String JSON_PROPERTY_AUTHORISATION_DECISION = "authorisationDecision"; + private AuthorisationDecisionResponse authorisationDecision; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + public RelayedAuthorisationResponse() {} + + /** + * authorisationDecision + * + * @param authorisationDecision + * @return the current {@code RelayedAuthorisationResponse} instance, allowing for method chaining + */ + public RelayedAuthorisationResponse authorisationDecision( + AuthorisationDecisionResponse authorisationDecision) { + this.authorisationDecision = authorisationDecision; + return this; + } + + /** + * Get authorisationDecision + * + * @return authorisationDecision + */ + @JsonProperty(JSON_PROPERTY_AUTHORISATION_DECISION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AuthorisationDecisionResponse getAuthorisationDecision() { + return authorisationDecision; + } + + /** + * authorisationDecision + * + * @param authorisationDecision + */ + @JsonProperty(JSON_PROPERTY_AUTHORISATION_DECISION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthorisationDecision(AuthorisationDecisionResponse authorisationDecision) { + this.authorisationDecision = authorisationDecision; + } + + /** + * Object that contains key-value pairs that you can use in your reporting or other business + * process. + * + * @param metadata Object that contains key-value pairs that you can use in your reporting or + * other business process. + * @return the current {@code RelayedAuthorisationResponse} instance, allowing for method chaining + */ + public RelayedAuthorisationResponse metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public RelayedAuthorisationResponse putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Object that contains key-value pairs that you can use in your reporting or other business + * process. + * + * @return metadata Object that contains key-value pairs that you can use in your reporting or + * other business process. + */ + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + /** + * Object that contains key-value pairs that you can use in your reporting or other business + * process. + * + * @param metadata Object that contains key-value pairs that you can use in your reporting or + * other business process. + */ + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + /** + * Reference of the payment. + * + * @param reference Reference of the payment. + * @return the current {@code RelayedAuthorisationResponse} instance, allowing for method chaining + */ + public RelayedAuthorisationResponse reference(String reference) { + this.reference = reference; + return this; + } + + /** + * Reference of the payment. + * + * @return reference Reference of the payment. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * Reference of the payment. + * + * @param reference Reference of the payment. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + } + + /** Return true if this RelayedAuthorisationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelayedAuthorisationResponse relayedAuthorisationResponse = (RelayedAuthorisationResponse) o; + return Objects.equals( + this.authorisationDecision, relayedAuthorisationResponse.authorisationDecision) + && Objects.equals(this.metadata, relayedAuthorisationResponse.metadata) + && Objects.equals(this.reference, relayedAuthorisationResponse.reference); + } + + @Override + public int hashCode() { + return Objects.hash(authorisationDecision, metadata, reference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelayedAuthorisationResponse {\n"); + sb.append(" authorisationDecision: ") + .append(toIndentedString(authorisationDecision)) + .append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).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 "); + } + + /** + * Create an instance of RelayedAuthorisationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RelayedAuthorisationResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * RelayedAuthorisationResponse + */ + public static RelayedAuthorisationResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, RelayedAuthorisationResponse.class); + } + + /** + * Convert an instance of RelayedAuthorisationResponse 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/relayedauthorizationwebhooks/RelayedAuthorizationWebhooksHandler.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/RelayedAuthorizationWebhooksHandler.java new file mode 100644 index 000000000..1f6f02805 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/RelayedAuthorizationWebhooksHandler.java @@ -0,0 +1,79 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +import java.util.Optional; +import java.util.logging.Logger; + +/** + * Handler for processing RelayedAuthorizationWebhooks. + * + *

This class provides functionality to deserialize the payload of RelayedAuthorizationWebhooks + * events. + */ +public class RelayedAuthorizationWebhooksHandler { + + private static final Logger LOG = + Logger.getLogger(RelayedAuthorizationWebhooksHandler.class.getName()); + + private final String payload; + + /** + * Constructs a new handler for the given webhook payload + * + * @param payload the raw JSON payload from the webhook + */ + public RelayedAuthorizationWebhooksHandler(String payload) { + this.payload = payload; + } + + /** + * Attempts to deserialize the webhook payload into a RelayedAuthorisationRequest + * + * @return an Optional containing the deserialized object, or empty if deserialization fails + */ + public Optional getRelayedAuthorisationRequest() { + + var optionalRelayedAuthorisationRequest = getOptionalField(RelayedAuthorisationRequest.class); + + if (optionalRelayedAuthorisationRequest.isPresent()) { + // verify event type + for (var value : RelayedAuthorisationRequest.TypeEnum.values()) { + if (value.equals(optionalRelayedAuthorisationRequest.get().getType())) { + // found matching event type + return optionalRelayedAuthorisationRequest; + } + } + } + + return Optional.empty(); + } + + /** + * Deserializes the payload into the specified class type. + * + * @param clazz the class to deserialize into + * @param the type of the class + * @return an Optional containing the deserialized object, or empty if an error occurs + */ + private Optional getOptionalField(Class clazz) { + try { + T val = JSON.getMapper().readValue(payload, clazz); + return Optional.ofNullable(val); + } catch (Exception e) { + // an error has occurred during deserialization (object not found, deserialization error) + LOG.warning("Object not found or unexpected error trying to access: " + clazz.getName()); + LOG.warning("Deserialization error: " + e.getMessage()); + return Optional.empty(); + } + } +} diff --git a/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ResourceReference.java new file mode 100644 index 000000000..efe92430a --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ResourceReference.java @@ -0,0 +1,197 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** ResourceReference */ +@JsonPropertyOrder({ + ResourceReference.JSON_PROPERTY_DESCRIPTION, + ResourceReference.JSON_PROPERTY_ID, + ResourceReference.JSON_PROPERTY_REFERENCE +}) +public class ResourceReference { + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + public ResourceReference() {} + + /** + * The description of the resource. + * + * @param description The description of the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference description(String description) { + this.description = description; + return this; + } + + /** + * The description of the resource. + * + * @return description The description of the resource. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * The description of the resource. + * + * @param description The description of the resource. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + /** + * The unique identifier of the resource. + * + * @param id The unique identifier of the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the resource. + * + * @return id The unique identifier of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the resource. + * + * @param id The unique identifier of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + /** + * The reference for the resource. + * + * @param reference The reference for the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference reference(String reference) { + this.reference = reference; + return this; + } + + /** + * The reference for the resource. + * + * @return reference The reference for the resource. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * The reference for the resource. + * + * @param reference The reference for the resource. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + } + + /** Return true if this ResourceReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResourceReference resourceReference = (ResourceReference) o; + return Objects.equals(this.description, resourceReference.description) + && Objects.equals(this.id, resourceReference.id) + && Objects.equals(this.reference, resourceReference.reference); + } + + @Override + public int hashCode() { + return Objects.hash(description, id, reference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResourceReference {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).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 "); + } + + /** + * Create an instance of ResourceReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResourceReference + * @throws JsonProcessingException if the JSON string is invalid with respect to ResourceReference + */ + public static ResourceReference fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ResourceReference.class); + } + + /** + * Convert an instance of ResourceReference 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/relayedauthorizationwebhooks/ServiceError.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ServiceError.java new file mode 100644 index 000000000..0f772f7f1 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ServiceError.java @@ -0,0 +1,275 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** ServiceError */ +@JsonPropertyOrder({ + ServiceError.JSON_PROPERTY_ERROR_CODE, + ServiceError.JSON_PROPERTY_ERROR_TYPE, + ServiceError.JSON_PROPERTY_MESSAGE, + ServiceError.JSON_PROPERTY_PSP_REFERENCE, + ServiceError.JSON_PROPERTY_STATUS +}) +public class ServiceError { + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; + private String errorCode; + + public static final String JSON_PROPERTY_ERROR_TYPE = "errorType"; + private String errorType; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; + private String pspReference; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Integer status; + + public ServiceError() {} + + /** + * The error code mapped to the error message. + * + * @param errorCode The error code mapped to the error message. + * @return the current {@code ServiceError} instance, allowing for method chaining + */ + public ServiceError errorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * The error code mapped to the error message. + * + * @return errorCode The error code mapped to the error message. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorCode() { + return errorCode; + } + + /** + * The error code mapped to the error message. + * + * @param errorCode The error code mapped to the error message. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + /** + * The category of the error. + * + * @param errorType The category of the error. + * @return the current {@code ServiceError} instance, allowing for method chaining + */ + public ServiceError errorType(String errorType) { + this.errorType = errorType; + return this; + } + + /** + * The category of the error. + * + * @return errorType The category of the error. + */ + @JsonProperty(JSON_PROPERTY_ERROR_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorType() { + return errorType; + } + + /** + * The category of the error. + * + * @param errorType The category of the error. + */ + @JsonProperty(JSON_PROPERTY_ERROR_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorType(String errorType) { + this.errorType = errorType; + } + + /** + * A short explanation of the issue. + * + * @param message A short explanation of the issue. + * @return the current {@code ServiceError} instance, allowing for method chaining + */ + public ServiceError message(String message) { + this.message = message; + return this; + } + + /** + * A short explanation of the issue. + * + * @return message A short explanation of the issue. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + /** + * A short explanation of the issue. + * + * @param message A short explanation of the issue. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + /** + * The PSP reference of the payment. + * + * @param pspReference The PSP reference of the payment. + * @return the current {@code ServiceError} instance, allowing for method chaining + */ + public ServiceError pspReference(String pspReference) { + this.pspReference = pspReference; + return this; + } + + /** + * The PSP reference of the payment. + * + * @return pspReference The PSP reference of the payment. + */ + @JsonProperty(JSON_PROPERTY_PSP_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPspReference() { + return pspReference; + } + + /** + * The PSP reference of the payment. + * + * @param pspReference The PSP reference of the payment. + */ + @JsonProperty(JSON_PROPERTY_PSP_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } + + /** + * The HTTP response status. + * + * @param status The HTTP response status. + * @return the current {@code ServiceError} instance, allowing for method chaining + */ + public ServiceError status(Integer status) { + this.status = status; + return this; + } + + /** + * The HTTP response status. + * + * @return status The HTTP response status. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStatus() { + return status; + } + + /** + * The HTTP response status. + * + * @param status The HTTP response status. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(Integer status) { + this.status = status; + } + + /** Return true if this ServiceError object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceError serviceError = (ServiceError) o; + return Objects.equals(this.errorCode, serviceError.errorCode) + && Objects.equals(this.errorType, serviceError.errorType) + && Objects.equals(this.message, serviceError.message) + && Objects.equals(this.pspReference, serviceError.pspReference) + && Objects.equals(this.status, serviceError.status); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, errorType, message, pspReference, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceError {\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorType: ").append(toIndentedString(errorType)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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 "); + } + + /** + * Create an instance of ServiceError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServiceError + * @throws JsonProcessingException if the JSON string is invalid with respect to ServiceError + */ + public static ServiceError fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ServiceError.class); + } + + /** + * Convert an instance of ServiceError 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/relayedauthorizationwebhooks/ThreeDSecure.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ThreeDSecure.java new file mode 100644 index 000000000..2dfa8413f --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ThreeDSecure.java @@ -0,0 +1,239 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** ThreeDSecure */ +@JsonPropertyOrder({ + ThreeDSecure.JSON_PROPERTY_ACS_TRANSACTION_ID, + ThreeDSecure.JSON_PROPERTY_AUTHENTICATION_RESULT, + ThreeDSecure.JSON_PROPERTY_AUTHENTICATION_TYPE, + ThreeDSecure.JSON_PROPERTY_DS_TRANSACTION_ID +}) +public class ThreeDSecure { + public static final String JSON_PROPERTY_ACS_TRANSACTION_ID = "acsTransactionId"; + private String acsTransactionId; + + public static final String JSON_PROPERTY_AUTHENTICATION_RESULT = "authenticationResult"; + private String authenticationResult; + + public static final String JSON_PROPERTY_AUTHENTICATION_TYPE = "authenticationType"; + private String authenticationType; + + public static final String JSON_PROPERTY_DS_TRANSACTION_ID = "dsTransactionId"; + private String dsTransactionId; + + public ThreeDSecure() {} + + /** + * The transaction identifier for the Access Control Server + * + * @param acsTransactionId The transaction identifier for the Access Control Server + * @return the current {@code ThreeDSecure} instance, allowing for method chaining + */ + public ThreeDSecure acsTransactionId(String acsTransactionId) { + this.acsTransactionId = acsTransactionId; + return this; + } + + /** + * The transaction identifier for the Access Control Server + * + * @return acsTransactionId The transaction identifier for the Access Control Server + */ + @JsonProperty(JSON_PROPERTY_ACS_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAcsTransactionId() { + return acsTransactionId; + } + + /** + * The transaction identifier for the Access Control Server + * + * @param acsTransactionId The transaction identifier for the Access Control Server + */ + @JsonProperty(JSON_PROPERTY_ACS_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcsTransactionId(String acsTransactionId) { + this.acsTransactionId = acsTransactionId; + } + + /** + * The result from the performed authentication + * + * @param authenticationResult The result from the performed authentication + * @return the current {@code ThreeDSecure} instance, allowing for method chaining + */ + public ThreeDSecure authenticationResult(String authenticationResult) { + this.authenticationResult = authenticationResult; + return this; + } + + /** + * The result from the performed authentication + * + * @return authenticationResult The result from the performed authentication + */ + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthenticationResult() { + return authenticationResult; + } + + /** + * The result from the performed authentication + * + * @param authenticationResult The result from the performed authentication + */ + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthenticationResult(String authenticationResult) { + this.authenticationResult = authenticationResult; + } + + /** + * The type of the performed authentication + * + * @param authenticationType The type of the performed authentication + * @return the current {@code ThreeDSecure} instance, allowing for method chaining + */ + public ThreeDSecure authenticationType(String authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * The type of the performed authentication + * + * @return authenticationType The type of the performed authentication + */ + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthenticationType() { + return authenticationType; + } + + /** + * The type of the performed authentication + * + * @param authenticationType The type of the performed authentication + */ + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthenticationType(String authenticationType) { + this.authenticationType = authenticationType; + } + + /** + * The transaction identifier for the Directory server + * + * @param dsTransactionId The transaction identifier for the Directory server + * @return the current {@code ThreeDSecure} instance, allowing for method chaining + */ + public ThreeDSecure dsTransactionId(String dsTransactionId) { + this.dsTransactionId = dsTransactionId; + return this; + } + + /** + * The transaction identifier for the Directory server + * + * @return dsTransactionId The transaction identifier for the Directory server + */ + @JsonProperty(JSON_PROPERTY_DS_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDsTransactionId() { + return dsTransactionId; + } + + /** + * The transaction identifier for the Directory server + * + * @param dsTransactionId The transaction identifier for the Directory server + */ + @JsonProperty(JSON_PROPERTY_DS_TRANSACTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDsTransactionId(String dsTransactionId) { + this.dsTransactionId = dsTransactionId; + } + + /** Return true if this ThreeDSecure object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ThreeDSecure threeDSecure = (ThreeDSecure) o; + return Objects.equals(this.acsTransactionId, threeDSecure.acsTransactionId) + && Objects.equals(this.authenticationResult, threeDSecure.authenticationResult) + && Objects.equals(this.authenticationType, threeDSecure.authenticationType) + && Objects.equals(this.dsTransactionId, threeDSecure.dsTransactionId); + } + + @Override + public int hashCode() { + return Objects.hash( + acsTransactionId, authenticationResult, authenticationType, dsTransactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ThreeDSecure {\n"); + sb.append(" acsTransactionId: ").append(toIndentedString(acsTransactionId)).append("\n"); + sb.append(" authenticationResult: ") + .append(toIndentedString(authenticationResult)) + .append("\n"); + sb.append(" authenticationType: ").append(toIndentedString(authenticationType)).append("\n"); + sb.append(" dsTransactionId: ").append(toIndentedString(dsTransactionId)).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 "); + } + + /** + * Create an instance of ThreeDSecure given an JSON string + * + * @param jsonString JSON string + * @return An instance of ThreeDSecure + * @throws JsonProcessingException if the JSON string is invalid with respect to ThreeDSecure + */ + public static ThreeDSecure fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ThreeDSecure.class); + } + + /** + * Convert an instance of ThreeDSecure 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/relayedauthorizationwebhooks/TransactionEventViolation.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionEventViolation.java new file mode 100644 index 000000000..07df09e07 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionEventViolation.java @@ -0,0 +1,203 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** TransactionEventViolation */ +@JsonPropertyOrder({ + TransactionEventViolation.JSON_PROPERTY_REASON, + TransactionEventViolation.JSON_PROPERTY_TRANSACTION_RULE, + TransactionEventViolation.JSON_PROPERTY_TRANSACTION_RULE_SOURCE +}) +public class TransactionEventViolation { + public static final String JSON_PROPERTY_REASON = "reason"; + private String reason; + + public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; + private TransactionRuleReference transactionRule; + + public static final String JSON_PROPERTY_TRANSACTION_RULE_SOURCE = "transactionRuleSource"; + private TransactionRuleSource transactionRuleSource; + + public TransactionEventViolation() {} + + /** + * An explanation about why the transaction rule failed. + * + * @param reason An explanation about why the transaction rule failed. + * @return the current {@code TransactionEventViolation} instance, allowing for method chaining + */ + public TransactionEventViolation reason(String reason) { + this.reason = reason; + return this; + } + + /** + * An explanation about why the transaction rule failed. + * + * @return reason An explanation about why the transaction rule failed. + */ + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReason() { + return reason; + } + + /** + * An explanation about why the transaction rule failed. + * + * @param reason An explanation about why the transaction rule failed. + */ + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReason(String reason) { + this.reason = reason; + } + + /** + * transactionRule + * + * @param transactionRule + * @return the current {@code TransactionEventViolation} instance, allowing for method chaining + */ + public TransactionEventViolation transactionRule(TransactionRuleReference transactionRule) { + this.transactionRule = transactionRule; + return this; + } + + /** + * Get transactionRule + * + * @return transactionRule + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionRuleReference getTransactionRule() { + return transactionRule; + } + + /** + * transactionRule + * + * @param transactionRule + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionRule(TransactionRuleReference transactionRule) { + this.transactionRule = transactionRule; + } + + /** + * transactionRuleSource + * + * @param transactionRuleSource + * @return the current {@code TransactionEventViolation} instance, allowing for method chaining + */ + public TransactionEventViolation transactionRuleSource( + TransactionRuleSource transactionRuleSource) { + this.transactionRuleSource = transactionRuleSource; + return this; + } + + /** + * Get transactionRuleSource + * + * @return transactionRuleSource + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_RULE_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionRuleSource getTransactionRuleSource() { + return transactionRuleSource; + } + + /** + * transactionRuleSource + * + * @param transactionRuleSource + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_RULE_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionRuleSource(TransactionRuleSource transactionRuleSource) { + this.transactionRuleSource = transactionRuleSource; + } + + /** Return true if this TransactionEventViolation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionEventViolation transactionEventViolation = (TransactionEventViolation) o; + return Objects.equals(this.reason, transactionEventViolation.reason) + && Objects.equals(this.transactionRule, transactionEventViolation.transactionRule) + && Objects.equals( + this.transactionRuleSource, transactionEventViolation.transactionRuleSource); + } + + @Override + public int hashCode() { + return Objects.hash(reason, transactionRule, transactionRuleSource); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionEventViolation {\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" transactionRule: ").append(toIndentedString(transactionRule)).append("\n"); + sb.append(" transactionRuleSource: ") + .append(toIndentedString(transactionRuleSource)) + .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 "); + } + + /** + * Create an instance of TransactionEventViolation given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionEventViolation + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionEventViolation + */ + public static TransactionEventViolation fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionEventViolation.class); + } + + /** + * Convert an instance of TransactionEventViolation 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/relayedauthorizationwebhooks/TransactionRuleReference.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionRuleReference.java new file mode 100644 index 000000000..03fa45333 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionRuleReference.java @@ -0,0 +1,283 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** TransactionRuleReference */ +@JsonPropertyOrder({ + TransactionRuleReference.JSON_PROPERTY_DESCRIPTION, + TransactionRuleReference.JSON_PROPERTY_ID, + TransactionRuleReference.JSON_PROPERTY_OUTCOME_TYPE, + TransactionRuleReference.JSON_PROPERTY_REFERENCE, + TransactionRuleReference.JSON_PROPERTY_SCORE +}) +public class TransactionRuleReference { + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; + private String outcomeType; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + public static final String JSON_PROPERTY_SCORE = "score"; + private Integer score; + + public TransactionRuleReference() {} + + /** + * The description of the resource. + * + * @param description The description of the resource. + * @return the current {@code TransactionRuleReference} instance, allowing for method chaining + */ + public TransactionRuleReference description(String description) { + this.description = description; + return this; + } + + /** + * The description of the resource. + * + * @return description The description of the resource. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * The description of the resource. + * + * @param description The description of the resource. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + /** + * The unique identifier of the resource. + * + * @param id The unique identifier of the resource. + * @return the current {@code TransactionRuleReference} instance, allowing for method chaining + */ + public TransactionRuleReference id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the resource. + * + * @return id The unique identifier of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the resource. + * + * @param id The unique identifier of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + /** + * The outcome type of the rule. + * + * @param outcomeType The outcome type of the rule. + * @return the current {@code TransactionRuleReference} instance, allowing for method chaining + */ + public TransactionRuleReference outcomeType(String outcomeType) { + this.outcomeType = outcomeType; + return this; + } + + /** + * The outcome type of the rule. + * + * @return outcomeType The outcome type of the rule. + */ + @JsonProperty(JSON_PROPERTY_OUTCOME_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOutcomeType() { + return outcomeType; + } + + /** + * The outcome type of the rule. + * + * @param outcomeType The outcome type of the rule. + */ + @JsonProperty(JSON_PROPERTY_OUTCOME_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutcomeType(String outcomeType) { + this.outcomeType = outcomeType; + } + + /** + * The reference for the resource. + * + * @param reference The reference for the resource. + * @return the current {@code TransactionRuleReference} instance, allowing for method chaining + */ + public TransactionRuleReference reference(String reference) { + this.reference = reference; + return this; + } + + /** + * The reference for the resource. + * + * @return reference The reference for the resource. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * The reference for the resource. + * + * @param reference The reference for the resource. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + } + + /** + * The transaction score determined by the rule. Returned only when `outcomeType` is + * **scoreBased**. + * + * @param score The transaction score determined by the rule. Returned only when + * `outcomeType` is **scoreBased**. + * @return the current {@code TransactionRuleReference} instance, allowing for method chaining + */ + public TransactionRuleReference score(Integer score) { + this.score = score; + return this; + } + + /** + * The transaction score determined by the rule. Returned only when `outcomeType` is + * **scoreBased**. + * + * @return score The transaction score determined by the rule. Returned only when + * `outcomeType` is **scoreBased**. + */ + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getScore() { + return score; + } + + /** + * The transaction score determined by the rule. Returned only when `outcomeType` is + * **scoreBased**. + * + * @param score The transaction score determined by the rule. Returned only when + * `outcomeType` is **scoreBased**. + */ + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScore(Integer score) { + this.score = score; + } + + /** Return true if this TransactionRuleReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionRuleReference transactionRuleReference = (TransactionRuleReference) o; + return Objects.equals(this.description, transactionRuleReference.description) + && Objects.equals(this.id, transactionRuleReference.id) + && Objects.equals(this.outcomeType, transactionRuleReference.outcomeType) + && Objects.equals(this.reference, transactionRuleReference.reference) + && Objects.equals(this.score, transactionRuleReference.score); + } + + @Override + public int hashCode() { + return Objects.hash(description, id, outcomeType, reference, score); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionRuleReference {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" outcomeType: ").append(toIndentedString(outcomeType)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).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 "); + } + + /** + * Create an instance of TransactionRuleReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionRuleReference + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionRuleReference + */ + public static TransactionRuleReference fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionRuleReference.class); + } + + /** + * Convert an instance of TransactionRuleReference 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/relayedauthorizationwebhooks/TransactionRuleSource.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionRuleSource.java new file mode 100644 index 000000000..ba9fda03e --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionRuleSource.java @@ -0,0 +1,177 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** TransactionRuleSource */ +@JsonPropertyOrder({ + TransactionRuleSource.JSON_PROPERTY_ID, + TransactionRuleSource.JSON_PROPERTY_TYPE +}) +public class TransactionRuleSource { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public TransactionRuleSource() {} + + /** + * ID of the resource, when applicable. + * + * @param id ID of the resource, when applicable. + * @return the current {@code TransactionRuleSource} instance, allowing for method chaining + */ + public TransactionRuleSource id(String id) { + this.id = id; + return this; + } + + /** + * ID of the resource, when applicable. + * + * @return id ID of the resource, when applicable. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * ID of the resource, when applicable. + * + * @param id ID of the resource, when applicable. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + /** + * Indicates the type of resource for which the transaction rule is defined. Possible values: * + * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * + * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule + * imposed by Adyen. + * + * @param type Indicates the type of resource for which the transaction rule is defined. Possible + * values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * + * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide + * rule imposed by Adyen. + * @return the current {@code TransactionRuleSource} instance, allowing for method chaining + */ + public TransactionRuleSource type(String type) { + this.type = type; + return this; + } + + /** + * Indicates the type of resource for which the transaction rule is defined. Possible values: * + * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * + * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule + * imposed by Adyen. + * + * @return type Indicates the type of resource for which the transaction rule is defined. Possible + * values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * + * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide + * rule imposed by Adyen. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * Indicates the type of resource for which the transaction rule is defined. Possible values: * + * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * + * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule + * imposed by Adyen. + * + * @param type Indicates the type of resource for which the transaction rule is defined. Possible + * values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * + * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide + * rule imposed by Adyen. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TransactionRuleSource object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionRuleSource transactionRuleSource = (TransactionRuleSource) o; + return Objects.equals(this.id, transactionRuleSource.id) + && Objects.equals(this.type, transactionRuleSource.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionRuleSource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create an instance of TransactionRuleSource given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionRuleSource + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionRuleSource + */ + public static TransactionRuleSource fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionRuleSource.class); + } + + /** + * Convert an instance of TransactionRuleSource 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/relayedauthorizationwebhooks/TransactionRulesResult.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionRulesResult.java new file mode 100644 index 000000000..1042111a8 --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionRulesResult.java @@ -0,0 +1,263 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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; + +/** TransactionRulesResult */ +@JsonPropertyOrder({ + TransactionRulesResult.JSON_PROPERTY_ADVICE, + TransactionRulesResult.JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED, + TransactionRulesResult.JSON_PROPERTY_SCORE, + TransactionRulesResult.JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES +}) +public class TransactionRulesResult { + public static final String JSON_PROPERTY_ADVICE = "advice"; + private String advice; + + public static final String JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED = "allHardBlockRulesPassed"; + private Boolean allHardBlockRulesPassed; + + public static final String JSON_PROPERTY_SCORE = "score"; + private Integer score; + + public static final String JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES = + "triggeredTransactionRules"; + private List triggeredTransactionRules; + + public TransactionRulesResult() {} + + /** + * The advice given by the Risk analysis. + * + * @param advice The advice given by the Risk analysis. + * @return the current {@code TransactionRulesResult} instance, allowing for method chaining + */ + public TransactionRulesResult advice(String advice) { + this.advice = advice; + return this; + } + + /** + * The advice given by the Risk analysis. + * + * @return advice The advice given by the Risk analysis. + */ + @JsonProperty(JSON_PROPERTY_ADVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAdvice() { + return advice; + } + + /** + * The advice given by the Risk analysis. + * + * @param advice The advice given by the Risk analysis. + */ + @JsonProperty(JSON_PROPERTY_ADVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdvice(String advice) { + this.advice = advice; + } + + /** + * Indicates whether the transaction passed the evaluation for all hardblock rules + * + * @param allHardBlockRulesPassed Indicates whether the transaction passed the evaluation for all + * hardblock rules + * @return the current {@code TransactionRulesResult} instance, allowing for method chaining + */ + public TransactionRulesResult allHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { + this.allHardBlockRulesPassed = allHardBlockRulesPassed; + return this; + } + + /** + * Indicates whether the transaction passed the evaluation for all hardblock rules + * + * @return allHardBlockRulesPassed Indicates whether the transaction passed the evaluation for all + * hardblock rules + */ + @JsonProperty(JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllHardBlockRulesPassed() { + return allHardBlockRulesPassed; + } + + /** + * Indicates whether the transaction passed the evaluation for all hardblock rules + * + * @param allHardBlockRulesPassed Indicates whether the transaction passed the evaluation for all + * hardblock rules + */ + @JsonProperty(JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { + this.allHardBlockRulesPassed = allHardBlockRulesPassed; + } + + /** + * The score of the Risk analysis. + * + * @param score The score of the Risk analysis. + * @return the current {@code TransactionRulesResult} instance, allowing for method chaining + */ + public TransactionRulesResult score(Integer score) { + this.score = score; + return this; + } + + /** + * The score of the Risk analysis. + * + * @return score The score of the Risk analysis. + */ + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getScore() { + return score; + } + + /** + * The score of the Risk analysis. + * + * @param score The score of the Risk analysis. + */ + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScore(Integer score) { + this.score = score; + } + + /** + * Array containing all the transaction rules that the transaction triggered. + * + * @param triggeredTransactionRules Array containing all the transaction rules that the + * transaction triggered. + * @return the current {@code TransactionRulesResult} instance, allowing for method chaining + */ + public TransactionRulesResult triggeredTransactionRules( + List triggeredTransactionRules) { + this.triggeredTransactionRules = triggeredTransactionRules; + return this; + } + + public TransactionRulesResult addTriggeredTransactionRulesItem( + TransactionEventViolation triggeredTransactionRulesItem) { + if (this.triggeredTransactionRules == null) { + this.triggeredTransactionRules = new ArrayList<>(); + } + this.triggeredTransactionRules.add(triggeredTransactionRulesItem); + return this; + } + + /** + * Array containing all the transaction rules that the transaction triggered. + * + * @return triggeredTransactionRules Array containing all the transaction rules that the + * transaction triggered. + */ + @JsonProperty(JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTriggeredTransactionRules() { + return triggeredTransactionRules; + } + + /** + * Array containing all the transaction rules that the transaction triggered. + * + * @param triggeredTransactionRules Array containing all the transaction rules that the + * transaction triggered. + */ + @JsonProperty(JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTriggeredTransactionRules( + List triggeredTransactionRules) { + this.triggeredTransactionRules = triggeredTransactionRules; + } + + /** Return true if this TransactionRulesResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionRulesResult transactionRulesResult = (TransactionRulesResult) o; + return Objects.equals(this.advice, transactionRulesResult.advice) + && Objects.equals( + this.allHardBlockRulesPassed, transactionRulesResult.allHardBlockRulesPassed) + && Objects.equals(this.score, transactionRulesResult.score) + && Objects.equals( + this.triggeredTransactionRules, transactionRulesResult.triggeredTransactionRules); + } + + @Override + public int hashCode() { + return Objects.hash(advice, allHardBlockRulesPassed, score, triggeredTransactionRules); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionRulesResult {\n"); + sb.append(" advice: ").append(toIndentedString(advice)).append("\n"); + sb.append(" allHardBlockRulesPassed: ") + .append(toIndentedString(allHardBlockRulesPassed)) + .append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" triggeredTransactionRules: ") + .append(toIndentedString(triggeredTransactionRules)) + .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 "); + } + + /** + * Create an instance of TransactionRulesResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionRulesResult + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionRulesResult + */ + public static TransactionRulesResult fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionRulesResult.class); + } + + /** + * Convert an instance of TransactionRulesResult 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/relayedauthorizationwebhooks/TransactionScoring.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionScoring.java new file mode 100644 index 000000000..7ccab628e --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/TransactionScoring.java @@ -0,0 +1,156 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** TransactionScoring */ +@JsonPropertyOrder({TransactionScoring.JSON_PROPERTY_TYPE, TransactionScoring.JSON_PROPERTY_VALUE}) +public class TransactionScoring { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public TransactionScoring() {} + + /** + * The type of score. + * + * @param type The type of score. + * @return the current {@code TransactionScoring} instance, allowing for method chaining + */ + public TransactionScoring type(String type) { + this.type = type; + return this; + } + + /** + * The type of score. + * + * @return type The type of score. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * The type of score. + * + * @param type The type of score. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + /** + * The value of the score. + * + * @param value The value of the score. + * @return the current {@code TransactionScoring} instance, allowing for method chaining + */ + public TransactionScoring value(String value) { + this.value = value; + return this; + } + + /** + * The value of the score. + * + * @return value The value of the score. + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + /** + * The value of the score. + * + * @param value The value of the score. + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this TransactionScoring object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionScoring transactionScoring = (TransactionScoring) o; + return Objects.equals(this.type, transactionScoring.type) + && Objects.equals(this.value, transactionScoring.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionScoring {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } + + /** + * Create an instance of TransactionScoring given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionScoring + * @throws JsonProcessingException if the JSON string is invalid with respect to + * TransactionScoring + */ + public static TransactionScoring fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TransactionScoring.class); + } + + /** + * Convert an instance of TransactionScoring 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/relayedauthorizationwebhooks/ValidationResult.java b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ValidationResult.java new file mode 100644 index 000000000..46c71d4df --- /dev/null +++ b/src/main/java/com/adyen/model/relayedauthorizationwebhooks/ValidationResult.java @@ -0,0 +1,173 @@ +/* + * Authorization webhooks + * + * The version of the OpenAPI document: 4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.relayedauthorizationwebhooks; + +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.*; + +/** ValidationResult */ +@JsonPropertyOrder({ValidationResult.JSON_PROPERTY_RESULT, ValidationResult.JSON_PROPERTY_TYPE}) +public class ValidationResult { + public static final String JSON_PROPERTY_RESULT = "result"; + private String result; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public ValidationResult() {} + + /** + * The result of the check. Possible values: - **valid**: The validation was successful. - + * **invalid**: The validation failed. - **notValidated**: The validation was not performed + * because some services were unreachable or Adyen does not have the information needed to perform + * the check. - **notApplicable**: The validation is not applicable. + * + * @param result The result of the check. Possible values: - **valid**: The validation was + * successful. - **invalid**: The validation failed. - **notValidated**: The validation was + * not performed because some services were unreachable or Adyen does not have the information + * needed to perform the check. - **notApplicable**: The validation is not applicable. + * @return the current {@code ValidationResult} instance, allowing for method chaining + */ + public ValidationResult result(String result) { + this.result = result; + return this; + } + + /** + * The result of the check. Possible values: - **valid**: The validation was successful. - + * **invalid**: The validation failed. - **notValidated**: The validation was not performed + * because some services were unreachable or Adyen does not have the information needed to perform + * the check. - **notApplicable**: The validation is not applicable. + * + * @return result The result of the check. Possible values: - **valid**: The validation was + * successful. - **invalid**: The validation failed. - **notValidated**: The validation was + * not performed because some services were unreachable or Adyen does not have the information + * needed to perform the check. - **notApplicable**: The validation is not applicable. + */ + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResult() { + return result; + } + + /** + * The result of the check. Possible values: - **valid**: The validation was successful. - + * **invalid**: The validation failed. - **notValidated**: The validation was not performed + * because some services were unreachable or Adyen does not have the information needed to perform + * the check. - **notApplicable**: The validation is not applicable. + * + * @param result The result of the check. Possible values: - **valid**: The validation was + * successful. - **invalid**: The validation failed. - **notValidated**: The validation was + * not performed because some services were unreachable or Adyen does not have the information + * needed to perform the check. - **notApplicable**: The validation is not applicable. + */ + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResult(String result) { + this.result = result; + } + + /** + * Type of check. + * + * @param type Type of check. + * @return the current {@code ValidationResult} instance, allowing for method chaining + */ + public ValidationResult type(String type) { + this.type = type; + return this; + } + + /** + * Type of check. + * + * @return type Type of check. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * Type of check. + * + * @param type Type of check. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this ValidationResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidationResult validationResult = (ValidationResult) o; + return Objects.equals(this.result, validationResult.result) + && Objects.equals(this.type, validationResult.type); + } + + @Override + public int hashCode() { + return Objects.hash(result, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidationResult {\n"); + sb.append(" result: ").append(toIndentedString(result)).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 "); + } + + /** + * Create an instance of ValidationResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of ValidationResult + * @throws JsonProcessingException if the JSON string is invalid with respect to ValidationResult + */ + public static ValidationResult fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ValidationResult.class); + } + + /** + * Convert an instance of ValidationResult to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +}