From e7b8ab12f133b9333e8b41fe5da58f8cb68c5282 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Thu, 15 Jan 2026 14:38:59 +0000 Subject: [PATCH] [capital] Automated update from Adyen/adyen-openapi@0a007ce --- .../capital/AULocalAccountIdentification.java | 310 +++++++++ .../model/capital/AbstractOpenApiSchema.java | 142 +++++ .../java/com/adyen/model/capital/Action.java | 222 +++++++ .../capital/AdditionalBankIdentification.java | 227 +++++++ .../AdditionalBankIdentificationTypes.java | 59 ++ .../java/com/adyen/model/capital/Amount.java | 234 +++++++ .../capital/BRLocalAccountIdentification.java | 404 ++++++++++++ .../java/com/adyen/model/capital/Balance.java | 334 ++++++++++ .../capital/BankAccountIdentification.java | 238 +++++++ .../capital/CALocalAccountIdentification.java | 405 ++++++++++++ .../model/capital/CALocalBankAccountType.java | 49 ++ .../capital/CZLocalAccountIdentification.java | 328 ++++++++++ .../com/adyen/model/capital/Counterparty.java | 308 +++++++++ .../capital/DKLocalAccountIdentification.java | 308 +++++++++ .../capital/DefaultErrorResponseEntity.java | 547 ++++++++++++++++ .../com/adyen/model/capital/Disbursement.java | 598 ++++++++++++++++++ .../model/capital/DisbursementInfoUpdate.java | 176 ++++++ .../model/capital/DisbursementRepayment.java | 239 +++++++ .../DisbursementRepaymentInfoUpdate.java | 243 +++++++ .../adyen/model/capital/Disbursements.java | 185 ++++++ .../java/com/adyen/model/capital/Fee.java | 175 +++++ .../adyen/model/capital/FundsCollection.java | 234 +++++++ .../model/capital/FundsCollectionType.java | 49 ++ .../java/com/adyen/model/capital/Grant.java | 485 ++++++++++++++ .../com/adyen/model/capital/GrantAccount.java | 359 +++++++++++ .../com/adyen/model/capital/GrantInfo.java | 335 ++++++++++ .../com/adyen/model/capital/GrantLimit.java | 175 +++++ .../com/adyen/model/capital/GrantOffer.java | 581 +++++++++++++++++ .../adyen/model/capital/GrantOfferFee.java | 231 +++++++ .../com/adyen/model/capital/GrantOffers.java | 185 ++++++ .../java/com/adyen/model/capital/Grants.java | 185 ++++++ .../capital/HKLocalAccountIdentification.java | 310 +++++++++ .../capital/HULocalAccountIdentification.java | 249 ++++++++ .../capital/IbanAccountIdentification.java | 255 ++++++++ .../com/adyen/model/capital/InvalidField.java | 273 ++++++++ .../java/com/adyen/model/capital/JSON.java | 251 ++++++++ .../capital/NOLocalAccountIdentification.java | 249 ++++++++ .../capital/NZLocalAccountIdentification.java | 261 ++++++++ .../NumberAndBicAccountIdentification.java | 376 +++++++++++ .../capital/PLLocalAccountIdentification.java | 261 ++++++++ .../com/adyen/model/capital/Repayment.java | 285 +++++++++ .../adyen/model/capital/RepaymentTerm.java | 231 +++++++ .../capital/SELocalAccountIdentification.java | 329 ++++++++++ .../capital/SGLocalAccountIdentification.java | 298 +++++++++ .../java/com/adyen/model/capital/Status.java | 315 +++++++++ .../model/capital/ThresholdRepayment.java | 176 ++++++ .../capital/UKLocalAccountIdentification.java | 310 +++++++++ .../capital/USLocalAccountIdentification.java | 363 +++++++++++ .../model/capital/USLocalBankAccountType.java | 49 ++ .../service/capital/GrantAccountsApi.java | 89 +++ .../adyen/service/capital/GrantOffersApi.java | 126 ++++ .../com/adyen/service/capital/GrantsApi.java | 293 +++++++++ 52 files changed, 13899 insertions(+) create mode 100644 src/main/java/com/adyen/model/capital/AULocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/capital/Action.java create mode 100644 src/main/java/com/adyen/model/capital/AdditionalBankIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/AdditionalBankIdentificationTypes.java create mode 100644 src/main/java/com/adyen/model/capital/Amount.java create mode 100644 src/main/java/com/adyen/model/capital/BRLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/Balance.java create mode 100644 src/main/java/com/adyen/model/capital/BankAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/CALocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/CALocalBankAccountType.java create mode 100644 src/main/java/com/adyen/model/capital/CZLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/Counterparty.java create mode 100644 src/main/java/com/adyen/model/capital/DKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/DefaultErrorResponseEntity.java create mode 100644 src/main/java/com/adyen/model/capital/Disbursement.java create mode 100644 src/main/java/com/adyen/model/capital/DisbursementInfoUpdate.java create mode 100644 src/main/java/com/adyen/model/capital/DisbursementRepayment.java create mode 100644 src/main/java/com/adyen/model/capital/DisbursementRepaymentInfoUpdate.java create mode 100644 src/main/java/com/adyen/model/capital/Disbursements.java create mode 100644 src/main/java/com/adyen/model/capital/Fee.java create mode 100644 src/main/java/com/adyen/model/capital/FundsCollection.java create mode 100644 src/main/java/com/adyen/model/capital/FundsCollectionType.java create mode 100644 src/main/java/com/adyen/model/capital/Grant.java create mode 100644 src/main/java/com/adyen/model/capital/GrantAccount.java create mode 100644 src/main/java/com/adyen/model/capital/GrantInfo.java create mode 100644 src/main/java/com/adyen/model/capital/GrantLimit.java create mode 100644 src/main/java/com/adyen/model/capital/GrantOffer.java create mode 100644 src/main/java/com/adyen/model/capital/GrantOfferFee.java create mode 100644 src/main/java/com/adyen/model/capital/GrantOffers.java create mode 100644 src/main/java/com/adyen/model/capital/Grants.java create mode 100644 src/main/java/com/adyen/model/capital/HKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/HULocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/IbanAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/InvalidField.java create mode 100644 src/main/java/com/adyen/model/capital/JSON.java create mode 100644 src/main/java/com/adyen/model/capital/NOLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/NZLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/NumberAndBicAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/PLLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/Repayment.java create mode 100644 src/main/java/com/adyen/model/capital/RepaymentTerm.java create mode 100644 src/main/java/com/adyen/model/capital/SELocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/SGLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/Status.java create mode 100644 src/main/java/com/adyen/model/capital/ThresholdRepayment.java create mode 100644 src/main/java/com/adyen/model/capital/UKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/USLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/capital/USLocalBankAccountType.java create mode 100644 src/main/java/com/adyen/service/capital/GrantAccountsApi.java create mode 100644 src/main/java/com/adyen/service/capital/GrantOffersApi.java create mode 100644 src/main/java/com/adyen/service/capital/GrantsApi.java diff --git a/src/main/java/com/adyen/model/capital/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/AULocalAccountIdentification.java new file mode 100644 index 000000000..8a037ea04 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/AULocalAccountIdentification.java @@ -0,0 +1,310 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** AULocalAccountIdentification */ +@JsonPropertyOrder({ + AULocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + AULocalAccountIdentification.JSON_PROPERTY_BSB_CODE, + AULocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class AULocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; + private String bsbCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AULocalAccountIdentification() {} + + /** + * The bank account number, without separators or whitespace. + * + * @param accountNumber The bank account number, without separators or whitespace. + * @return the current {@code AULocalAccountIdentification} instance, allowing for method chaining + */ + public AULocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + 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; + isSetAccountNumber = true; // mark as set + } + + /** + * The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), + * without separators or whitespace. + * + * @param bsbCode The 6-digit [Bank State Branch (BSB) + * code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + * @return the current {@code AULocalAccountIdentification} instance, allowing for method chaining + */ + public AULocalAccountIdentification bsbCode(String bsbCode) { + this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set + return this; + } + + /** + * The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), + * without separators or whitespace. + * + * @return bsbCode The 6-digit [Bank State Branch (BSB) + * code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_BSB_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBsbCode() { + return bsbCode; + } + + /** + * The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), + * without separators or whitespace. + * + * @param bsbCode The 6-digit [Bank State Branch (BSB) + * code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_BSB_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBsbCode(String bsbCode) { + this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set + } + + /** + * **auLocal** + * + * @param type **auLocal** + * @return the current {@code AULocalAccountIdentification} instance, allowing for method chaining + */ + public AULocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **auLocal** + * + * @return type **auLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **auLocal** + * + * @param type **auLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AULocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AULocalAccountIdentification auLocalAccountIdentification = (AULocalAccountIdentification) o; + return Objects.equals(this.accountNumber, auLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, auLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.bsbCode, auLocalAccountIdentification.bsbCode) + && Objects.equals(this.isSetBsbCode, auLocalAccountIdentification.isSetBsbCode) + && Objects.equals(this.type, auLocalAccountIdentification.type) + && Objects.equals(this.isSetType, auLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + bsbCode, + isSetBsbCode, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AULocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bsbCode: ").append(toIndentedString(bsbCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("AULocalAccountIdentification", AULocalAccountIdentification.class); + JSON.registerDiscriminator(AULocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AULocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of AULocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * AULocalAccountIdentification + */ + public static AULocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AULocalAccountIdentification.class); + } + + /** + * Convert an instance of AULocalAccountIdentification 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/capital/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java new file mode 100644 index 000000000..bb8d23ab4 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java @@ -0,0 +1,142 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +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/capital/Action.java b/src/main/java/com/adyen/model/capital/Action.java new file mode 100644 index 000000000..bd81b2681 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Action.java @@ -0,0 +1,222 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Action */ +@JsonPropertyOrder({Action.JSON_PROPERTY_ACTION_CODE, Action.JSON_PROPERTY_RESOLVED}) +public class Action { + public static final String JSON_PROPERTY_ACTION_CODE = "actionCode"; + private String actionCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActionCode = false; + + public static final String JSON_PROPERTY_RESOLVED = "resolved"; + private Boolean resolved; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResolved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Action() {} + + /** + * The code identifying the action that needs to be completed. + * + * @param actionCode The code identifying the action that needs to be completed. + * @return the current {@code Action} instance, allowing for method chaining + */ + public Action actionCode(String actionCode) { + this.actionCode = actionCode; + isSetActionCode = true; // mark as set + return this; + } + + /** + * The code identifying the action that needs to be completed. + * + * @return actionCode The code identifying the action that needs to be completed. + */ + @JsonProperty(JSON_PROPERTY_ACTION_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getActionCode() { + return actionCode; + } + + /** + * The code identifying the action that needs to be completed. + * + * @param actionCode The code identifying the action that needs to be completed. + */ + @JsonProperty(JSON_PROPERTY_ACTION_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActionCode(String actionCode) { + this.actionCode = actionCode; + isSetActionCode = true; // mark as set + } + + /** + * Indicates whether this action has been successfully completed. + * + * @param resolved Indicates whether this action has been successfully completed. + * @return the current {@code Action} instance, allowing for method chaining + */ + public Action resolved(Boolean resolved) { + this.resolved = resolved; + isSetResolved = true; // mark as set + return this; + } + + /** + * Indicates whether this action has been successfully completed. + * + * @return resolved Indicates whether this action has been successfully completed. + */ + @JsonProperty(JSON_PROPERTY_RESOLVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getResolved() { + return resolved; + } + + /** + * Indicates whether this action has been successfully completed. + * + * @param resolved Indicates whether this action has been successfully completed. + */ + @JsonProperty(JSON_PROPERTY_RESOLVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResolved(Boolean resolved) { + this.resolved = resolved; + isSetResolved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Action includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Action object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Action action = (Action) o; + return Objects.equals(this.actionCode, action.actionCode) + && Objects.equals(this.isSetActionCode, action.isSetActionCode) + && Objects.equals(this.resolved, action.resolved) + && Objects.equals(this.isSetResolved, action.isSetResolved); + } + + @Override + public int hashCode() { + return Objects.hash(actionCode, isSetActionCode, resolved, isSetResolved); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Action {\n"); + sb.append(" actionCode: ").append(toIndentedString(actionCode)).append("\n"); + sb.append(" resolved: ").append(toIndentedString(resolved)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetActionCode) { + addIfNull(nulls, JSON_PROPERTY_ACTION_CODE, this.actionCode); + } + if (isSetResolved) { + addIfNull(nulls, JSON_PROPERTY_RESOLVED, this.resolved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Action given an JSON string + * + * @param jsonString JSON string + * @return An instance of Action + * @throws JsonProcessingException if the JSON string is invalid with respect to Action + */ + public static Action fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Action.class); + } + + /** + * Convert an instance of Action 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/capital/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/capital/AdditionalBankIdentification.java new file mode 100644 index 000000000..e1a11933d --- /dev/null +++ b/src/main/java/com/adyen/model/capital/AdditionalBankIdentification.java @@ -0,0 +1,227 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** AdditionalBankIdentification */ +@JsonPropertyOrder({ + AdditionalBankIdentification.JSON_PROPERTY_CODE, + AdditionalBankIdentification.JSON_PROPERTY_TYPE +}) +public class AdditionalBankIdentification { + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AdditionalBankIdentificationTypes type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AdditionalBankIdentification() {} + + /** + * The value of the additional bank identification. + * + * @param code The value of the additional bank identification. + * @return the current {@code AdditionalBankIdentification} instance, allowing for method chaining + */ + public AdditionalBankIdentification code(String code) { + this.code = code; + isSetCode = true; // mark as set + return this; + } + + /** + * The value of the additional bank identification. + * + * @return code The value of the additional bank identification. + */ + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCode() { + return code; + } + + /** + * The value of the additional bank identification. + * + * @param code The value of the additional bank identification. + */ + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(String code) { + this.code = code; + isSetCode = true; // mark as set + } + + /** + * type + * + * @param type + * @return the current {@code AdditionalBankIdentification} instance, allowing for method chaining + */ + public AdditionalBankIdentification type(AdditionalBankIdentificationTypes type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Get type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AdditionalBankIdentificationTypes getType() { + return type; + } + + /** + * type + * + * @param type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(AdditionalBankIdentificationTypes type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalBankIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AdditionalBankIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalBankIdentification additionalBankIdentification = (AdditionalBankIdentification) o; + return Objects.equals(this.code, additionalBankIdentification.code) + && Objects.equals(this.isSetCode, additionalBankIdentification.isSetCode) + && Objects.equals(this.type, additionalBankIdentification.type) + && Objects.equals(this.isSetType, additionalBankIdentification.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash(code, isSetCode, type, isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalBankIdentification {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AdditionalBankIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalBankIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * AdditionalBankIdentification + */ + public static AdditionalBankIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AdditionalBankIdentification.class); + } + + /** + * Convert an instance of AdditionalBankIdentification 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/capital/AdditionalBankIdentificationTypes.java b/src/main/java/com/adyen/model/capital/AdditionalBankIdentificationTypes.java new file mode 100644 index 000000000..21da23da9 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/AdditionalBankIdentificationTypes.java @@ -0,0 +1,59 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets AdditionalBankIdentificationTypes */ +public enum AdditionalBankIdentificationTypes { + AUBSBCODE("auBsbCode"), + + CAROUTINGNUMBER("caRoutingNumber"), + + GBSORTCODE("gbSortCode"), + + HKBANKCODE("hkBankCode"), + + JPZENGINCODE("jpZenginCode"), + + NZBANKBRANCHCODE("nzBankBranchCode"), + + USROUTINGNUMBER("usRoutingNumber"); + + private String value; + + AdditionalBankIdentificationTypes(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AdditionalBankIdentificationTypes fromValue(String value) { + for (AdditionalBankIdentificationTypes b : AdditionalBankIdentificationTypes.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/capital/Amount.java b/src/main/java/com/adyen/model/capital/Amount.java new file mode 100644 index 000000000..96588cdf7 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Amount.java @@ -0,0 +1,234 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Amount */ +@JsonPropertyOrder({Amount.JSON_PROPERTY_CURRENCY, Amount.JSON_PROPERTY_VALUE}) +public class Amount { + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Amount() {} + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * @return the current {@code Amount} instance, allowing for method chaining + */ + public Amount currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @return currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#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#currency-codes). + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @param value The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * @return the current {@code Amount} instance, allowing for method chaining + */ + public Amount value(Long value) { + this.value = value; + isSetValue = true; // mark as set + return this; + } + + /** + * The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @return value The amount of the transaction, 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 amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @param value The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Long value) { + this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Amount object is equal to o. */ + @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.isSetCurrency, amount.isSetCurrency) + && Objects.equals(this.value, amount.value) + && Objects.equals(this.isSetValue, amount.isSetValue); + } + + @Override + public int hashCode() { + return Objects.hash(currency, isSetCurrency, value, isSetValue); + } + + @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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Amount given an JSON string + * + * @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/capital/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/BRLocalAccountIdentification.java new file mode 100644 index 000000000..8cb354381 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/BRLocalAccountIdentification.java @@ -0,0 +1,404 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** BRLocalAccountIdentification */ +@JsonPropertyOrder({ + BRLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + BRLocalAccountIdentification.JSON_PROPERTY_BANK_CODE, + BRLocalAccountIdentification.JSON_PROPERTY_BRANCH_NUMBER, + BRLocalAccountIdentification.JSON_PROPERTY_ISPB, + BRLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class BRLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; + private String bankCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; + private String branchNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + + public static final String JSON_PROPERTY_ISPB = "ispb"; + private String ispb; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIspb = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public BRLocalAccountIdentification() {} + + /** + * The bank account number, without separators or whitespace. + * + * @param accountNumber The bank account number, without separators or whitespace. + * @return the current {@code BRLocalAccountIdentification} instance, allowing for method chaining + */ + public BRLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + 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; + isSetAccountNumber = true; // mark as set + } + + /** + * The 3-digit bank code, with leading zeros. + * + * @param bankCode The 3-digit bank code, with leading zeros. + * @return the current {@code BRLocalAccountIdentification} instance, allowing for method chaining + */ + public BRLocalAccountIdentification bankCode(String bankCode) { + this.bankCode = bankCode; + isSetBankCode = true; // mark as set + return this; + } + + /** + * The 3-digit bank code, with leading zeros. + * + * @return bankCode The 3-digit bank code, with leading zeros. + */ + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBankCode() { + return bankCode; + } + + /** + * The 3-digit bank code, with leading zeros. + * + * @param bankCode The 3-digit bank code, with leading zeros. + */ + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + isSetBankCode = true; // mark as set + } + + /** + * The bank account branch number, without separators or whitespace. + * + * @param branchNumber The bank account branch number, without separators or whitespace. + * @return the current {@code BRLocalAccountIdentification} instance, allowing for method chaining + */ + public BRLocalAccountIdentification branchNumber(String branchNumber) { + this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set + 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; + isSetBranchNumber = true; // mark as set + } + + /** + * The 8-digit ISPB, with leading zeros. + * + * @param ispb The 8-digit ISPB, with leading zeros. + * @return the current {@code BRLocalAccountIdentification} instance, allowing for method chaining + */ + public BRLocalAccountIdentification ispb(String ispb) { + this.ispb = ispb; + isSetIspb = true; // mark as set + return this; + } + + /** + * The 8-digit ISPB, with leading zeros. + * + * @return ispb The 8-digit ISPB, with leading zeros. + */ + @JsonProperty(JSON_PROPERTY_ISPB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIspb() { + return ispb; + } + + /** + * The 8-digit ISPB, with leading zeros. + * + * @param ispb The 8-digit ISPB, with leading zeros. + */ + @JsonProperty(JSON_PROPERTY_ISPB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIspb(String ispb) { + this.ispb = ispb; + isSetIspb = true; // mark as set + } + + /** + * **brLocal** + * + * @param type **brLocal** + * @return the current {@code BRLocalAccountIdentification} instance, allowing for method chaining + */ + public BRLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **brLocal** + * + * @return type **brLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **brLocal** + * + * @param type **brLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BRLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this BRLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BRLocalAccountIdentification brLocalAccountIdentification = (BRLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, brLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, brLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.bankCode, brLocalAccountIdentification.bankCode) + && Objects.equals(this.isSetBankCode, brLocalAccountIdentification.isSetBankCode) + && Objects.equals(this.branchNumber, brLocalAccountIdentification.branchNumber) + && Objects.equals(this.isSetBranchNumber, brLocalAccountIdentification.isSetBranchNumber) + && Objects.equals(this.ispb, brLocalAccountIdentification.ispb) + && Objects.equals(this.isSetIspb, brLocalAccountIdentification.isSetIspb) + && Objects.equals(this.type, brLocalAccountIdentification.type) + && Objects.equals(this.isSetType, brLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + bankCode, + isSetBankCode, + branchNumber, + isSetBranchNumber, + ispb, + isSetIspb, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BRLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bankCode: ").append(toIndentedString(bankCode)).append("\n"); + sb.append(" branchNumber: ").append(toIndentedString(branchNumber)).append("\n"); + sb.append(" ispb: ").append(toIndentedString(ispb)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("BRLocalAccountIdentification", BRLocalAccountIdentification.class); + JSON.registerDiscriminator(BRLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetIspb) { + addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of BRLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of BRLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * BRLocalAccountIdentification + */ + public static BRLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, BRLocalAccountIdentification.class); + } + + /** + * Convert an instance of BRLocalAccountIdentification 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/capital/Balance.java b/src/main/java/com/adyen/model/capital/Balance.java new file mode 100644 index 000000000..7bbbed8f9 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Balance.java @@ -0,0 +1,334 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Balance */ +@JsonPropertyOrder({ + Balance.JSON_PROPERTY_CURRENCY, + Balance.JSON_PROPERTY_FEE, + Balance.JSON_PROPERTY_PRINCIPAL, + Balance.JSON_PROPERTY_TOTAL +}) +public class Balance { + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_FEE = "fee"; + private Long fee; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + + public static final String JSON_PROPERTY_PRINCIPAL = "principal"; + private Long principal; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipal = false; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Balance() {} + + /** + * 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 Balance} instance, allowing for method chaining + */ + public Balance currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @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; + isSetCurrency = true; // mark as set + } + + /** + * The amount of the grant fee. + * + * @param fee The amount of the grant fee. + * @return the current {@code Balance} instance, allowing for method chaining + */ + public Balance fee(Long fee) { + this.fee = fee; + isSetFee = true; // mark as set + return this; + } + + /** + * The amount of the grant fee. + * + * @return fee The amount of the grant fee. + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFee() { + return fee; + } + + /** + * The amount of the grant fee. + * + * @param fee The amount of the grant fee. + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFee(Long fee) { + this.fee = fee; + isSetFee = true; // mark as set + } + + /** + * The grant amount that is paid out to the user for business financing. + * + * @param principal The grant amount that is paid out to the user for business financing. + * @return the current {@code Balance} instance, allowing for method chaining + */ + public Balance principal(Long principal) { + this.principal = principal; + isSetPrincipal = true; // mark as set + return this; + } + + /** + * The grant amount that is paid out to the user for business financing. + * + * @return principal The grant amount that is paid out to the user for business financing. + */ + @JsonProperty(JSON_PROPERTY_PRINCIPAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPrincipal() { + return principal; + } + + /** + * The grant amount that is paid out to the user for business financing. + * + * @param principal The grant amount that is paid out to the user for business financing. + */ + @JsonProperty(JSON_PROPERTY_PRINCIPAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrincipal(Long principal) { + this.principal = principal; + isSetPrincipal = true; // mark as set + } + + /** + * The total amount of the grant that the user must repay. It is the sum of the fee amount and the + * principal amount. + * + * @param total The total amount of the grant that the user must repay. It is the sum of the fee + * amount and the principal amount. + * @return the current {@code Balance} instance, allowing for method chaining + */ + public Balance total(Long total) { + this.total = total; + isSetTotal = true; // mark as set + return this; + } + + /** + * The total amount of the grant that the user must repay. It is the sum of the fee amount and the + * principal amount. + * + * @return total The total amount of the grant that the user must repay. It is the sum of the fee + * amount and the principal amount. + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotal() { + return total; + } + + /** + * The total amount of the grant that the user must repay. It is the sum of the fee amount and the + * principal amount. + * + * @param total The total amount of the grant that the user must repay. It is the sum of the fee + * amount and the principal amount. + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotal(Long total) { + this.total = total; + isSetTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Balance includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Balance object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Balance balance = (Balance) o; + return Objects.equals(this.currency, balance.currency) + && Objects.equals(this.isSetCurrency, balance.isSetCurrency) + && Objects.equals(this.fee, balance.fee) + && Objects.equals(this.isSetFee, balance.isSetFee) + && Objects.equals(this.principal, balance.principal) + && Objects.equals(this.isSetPrincipal, balance.isSetPrincipal) + && Objects.equals(this.total, balance.total) + && Objects.equals(this.isSetTotal, balance.isSetTotal); + } + + @Override + public int hashCode() { + return Objects.hash( + currency, isSetCurrency, fee, isSetFee, principal, isSetPrincipal, total, isSetTotal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Balance {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" principal: ").append(toIndentedString(principal)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetPrincipal) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL, this.principal); + } + if (isSetTotal) { + addIfNull(nulls, JSON_PROPERTY_TOTAL, this.total); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Balance given an JSON string + * + * @param jsonString JSON string + * @return An instance of Balance + * @throws JsonProcessingException if the JSON string is invalid with respect to Balance + */ + public static Balance fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Balance.class); + } + + /** + * Convert an instance of Balance 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/capital/BankAccountIdentification.java b/src/main/java/com/adyen/model/capital/BankAccountIdentification.java new file mode 100644 index 000000000..f5e7c0705 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/BankAccountIdentification.java @@ -0,0 +1,238 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** BankAccountIdentification */ +@JsonPropertyOrder({BankAccountIdentification.JSON_PROPERTY_TYPE}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = AULocalAccountIdentification.class, name = "auLocal"), + @JsonSubTypes.Type(value = BRLocalAccountIdentification.class, name = "brLocal"), + @JsonSubTypes.Type(value = CALocalAccountIdentification.class, name = "caLocal"), + @JsonSubTypes.Type(value = CZLocalAccountIdentification.class, name = "czLocal"), + @JsonSubTypes.Type(value = DKLocalAccountIdentification.class, name = "dkLocal"), + @JsonSubTypes.Type(value = HKLocalAccountIdentification.class, name = "hkLocal"), + @JsonSubTypes.Type(value = HULocalAccountIdentification.class, name = "huLocal"), + @JsonSubTypes.Type(value = IbanAccountIdentification.class, name = "iban"), + @JsonSubTypes.Type(value = NOLocalAccountIdentification.class, name = "noLocal"), + @JsonSubTypes.Type(value = NumberAndBicAccountIdentification.class, name = "numberAndBic"), + @JsonSubTypes.Type(value = NZLocalAccountIdentification.class, name = "nzLocal"), + @JsonSubTypes.Type(value = PLLocalAccountIdentification.class, name = "plLocal"), + @JsonSubTypes.Type(value = SELocalAccountIdentification.class, name = "seLocal"), + @JsonSubTypes.Type(value = SGLocalAccountIdentification.class, name = "sgLocal"), + @JsonSubTypes.Type(value = UKLocalAccountIdentification.class, name = "ukLocal"), + @JsonSubTypes.Type(value = USLocalAccountIdentification.class, name = "usLocal"), +}) +public class BankAccountIdentification { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public BankAccountIdentification() {} + + /** + * The type of account, which depends on the country of the account and the currency of the + * transfer. + * + * @param type The type of account, which depends on the country of the account and the currency + * of the transfer. + * @return the current {@code BankAccountIdentification} instance, allowing for method chaining + */ + public BankAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * The type of account, which depends on the country of the account and the currency of the + * transfer. + * + * @return type The type of account, which depends on the country of the account and the currency + * of the transfer. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * The type of account, which depends on the country of the account and the currency of the + * transfer. + * + * @param type The type of account, which depends on the country of the account and the currency + * of the transfer. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this BankAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankAccountIdentification bankAccountIdentification = (BankAccountIdentification) o; + return Objects.equals(this.type, bankAccountIdentification.type) + && Objects.equals(this.isSetType, bankAccountIdentification.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash(type, isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BankAccountIdentification {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("auLocal", AULocalAccountIdentification.class); + mappings.put("brLocal", BRLocalAccountIdentification.class); + mappings.put("caLocal", CALocalAccountIdentification.class); + mappings.put("czLocal", CZLocalAccountIdentification.class); + mappings.put("dkLocal", DKLocalAccountIdentification.class); + mappings.put("hkLocal", HKLocalAccountIdentification.class); + mappings.put("huLocal", HULocalAccountIdentification.class); + mappings.put("iban", IbanAccountIdentification.class); + mappings.put("noLocal", NOLocalAccountIdentification.class); + mappings.put("numberAndBic", NumberAndBicAccountIdentification.class); + mappings.put("nzLocal", NZLocalAccountIdentification.class); + mappings.put("plLocal", PLLocalAccountIdentification.class); + mappings.put("seLocal", SELocalAccountIdentification.class); + mappings.put("sgLocal", SGLocalAccountIdentification.class); + mappings.put("ukLocal", UKLocalAccountIdentification.class); + mappings.put("usLocal", USLocalAccountIdentification.class); + mappings.put("BankAccountIdentification", BankAccountIdentification.class); + JSON.registerDiscriminator(BankAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of BankAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of BankAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * BankAccountIdentification + */ + public static BankAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, BankAccountIdentification.class); + } + + /** + * Convert an instance of BankAccountIdentification 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/capital/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/CALocalAccountIdentification.java new file mode 100644 index 000000000..a64b208d9 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/CALocalAccountIdentification.java @@ -0,0 +1,405 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CALocalAccountIdentification */ +@JsonPropertyOrder({ + CALocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + CALocalAccountIdentification.JSON_PROPERTY_ACCOUNT_TYPE, + CALocalAccountIdentification.JSON_PROPERTY_INSTITUTION_NUMBER, + CALocalAccountIdentification.JSON_PROPERTY_TRANSIT_NUMBER, + CALocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class CALocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; + private CALocalBankAccountType accountType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + + public static final String JSON_PROPERTY_INSTITUTION_NUMBER = "institutionNumber"; + private String institutionNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; + private String transitNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CALocalAccountIdentification() {} + + /** + * The 5- to 12-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 5- to 12-digit bank account number, without separators or whitespace. + * @return the current {@code CALocalAccountIdentification} instance, allowing for method chaining + */ + public CALocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 5- to 12-digit bank account number, without separators or whitespace. + * + * @return accountNumber The 5- to 12-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 5- to 12-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 5- to 12-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * accountType + * + * @param accountType + * @return the current {@code CALocalAccountIdentification} instance, allowing for method chaining + */ + public CALocalAccountIdentification accountType(CALocalBankAccountType accountType) { + this.accountType = accountType; + isSetAccountType = true; // mark as set + return this; + } + + /** + * Get accountType + * + * @return accountType + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CALocalBankAccountType getAccountType() { + return accountType; + } + + /** + * accountType + * + * @param accountType + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountType(CALocalBankAccountType accountType) { + this.accountType = accountType; + isSetAccountType = true; // mark as set + } + + /** + * The 3-digit institution number, without separators or whitespace. + * + * @param institutionNumber The 3-digit institution number, without separators or whitespace. + * @return the current {@code CALocalAccountIdentification} instance, allowing for method chaining + */ + public CALocalAccountIdentification institutionNumber(String institutionNumber) { + this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set + return this; + } + + /** + * The 3-digit institution number, without separators or whitespace. + * + * @return institutionNumber The 3-digit institution number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_INSTITUTION_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstitutionNumber() { + return institutionNumber; + } + + /** + * The 3-digit institution number, without separators or whitespace. + * + * @param institutionNumber The 3-digit institution number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_INSTITUTION_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstitutionNumber(String institutionNumber) { + this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set + } + + /** + * The 5-digit transit number, without separators or whitespace. + * + * @param transitNumber The 5-digit transit number, without separators or whitespace. + * @return the current {@code CALocalAccountIdentification} instance, allowing for method chaining + */ + public CALocalAccountIdentification transitNumber(String transitNumber) { + this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set + return this; + } + + /** + * The 5-digit transit number, without separators or whitespace. + * + * @return transitNumber The 5-digit transit number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_TRANSIT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransitNumber() { + return transitNumber; + } + + /** + * The 5-digit transit number, without separators or whitespace. + * + * @param transitNumber The 5-digit transit number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_TRANSIT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransitNumber(String transitNumber) { + this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set + } + + /** + * **caLocal** + * + * @param type **caLocal** + * @return the current {@code CALocalAccountIdentification} instance, allowing for method chaining + */ + public CALocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **caLocal** + * + * @return type **caLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **caLocal** + * + * @param type **caLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CALocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CALocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CALocalAccountIdentification caLocalAccountIdentification = (CALocalAccountIdentification) o; + return Objects.equals(this.accountNumber, caLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, caLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.accountType, caLocalAccountIdentification.accountType) + && Objects.equals(this.isSetAccountType, caLocalAccountIdentification.isSetAccountType) + && Objects.equals(this.institutionNumber, caLocalAccountIdentification.institutionNumber) + && Objects.equals( + this.isSetInstitutionNumber, caLocalAccountIdentification.isSetInstitutionNumber) + && Objects.equals(this.transitNumber, caLocalAccountIdentification.transitNumber) + && Objects.equals(this.isSetTransitNumber, caLocalAccountIdentification.isSetTransitNumber) + && Objects.equals(this.type, caLocalAccountIdentification.type) + && Objects.equals(this.isSetType, caLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + accountType, + isSetAccountType, + institutionNumber, + isSetInstitutionNumber, + transitNumber, + isSetTransitNumber, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CALocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" institutionNumber: ").append(toIndentedString(institutionNumber)).append("\n"); + sb.append(" transitNumber: ").append(toIndentedString(transitNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("CALocalAccountIdentification", CALocalAccountIdentification.class); + JSON.registerDiscriminator(CALocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CALocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of CALocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CALocalAccountIdentification + */ + public static CALocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CALocalAccountIdentification.class); + } + + /** + * Convert an instance of CALocalAccountIdentification 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/capital/CALocalBankAccountType.java b/src/main/java/com/adyen/model/capital/CALocalBankAccountType.java new file mode 100644 index 000000000..04cc9b81b --- /dev/null +++ b/src/main/java/com/adyen/model/capital/CALocalBankAccountType.java @@ -0,0 +1,49 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets CALocalBankAccountType */ +public enum CALocalBankAccountType { + CHECKING("checking"), + + SAVINGS("savings"); + + private String value; + + CALocalBankAccountType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CALocalBankAccountType fromValue(String value) { + for (CALocalBankAccountType b : CALocalBankAccountType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/capital/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/CZLocalAccountIdentification.java new file mode 100644 index 000000000..8df446b03 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/CZLocalAccountIdentification.java @@ -0,0 +1,328 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CZLocalAccountIdentification */ +@JsonPropertyOrder({ + CZLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + CZLocalAccountIdentification.JSON_PROPERTY_BANK_CODE, + CZLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class CZLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; + private String bankCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CZLocalAccountIdentification() {} + + /** + * The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional + * prefix (předčíslí). - The required second part (základní část) which must be at least two + * non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - + * **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, + * normalized) + * + * @param accountNumber The 2- to 16-digit bank account number (Číslo účtu) in the following + * format: - The optional prefix (předčíslí). - The required second part (základní část) which + * must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** + * (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** + * (without prefix, normalized) + * @return the current {@code CZLocalAccountIdentification} instance, allowing for method chaining + */ + public CZLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional + * prefix (předčíslí). - The required second part (základní část) which must be at least two + * non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - + * **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, + * normalized) + * + * @return accountNumber The 2- to 16-digit bank account number (Číslo účtu) in the following + * format: - The optional prefix (předčíslí). - The required second part (základní část) which + * must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** + * (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** + * (without prefix, normalized) + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional + * prefix (předčíslí). - The required second part (základní část) which must be at least two + * non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - + * **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, + * normalized) + * + * @param accountNumber The 2- to 16-digit bank account number (Číslo účtu) in the following + * format: - The optional prefix (předčíslí). - The required second part (základní část) which + * must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** + * (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** + * (without prefix, normalized) + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * The 4-digit bank code (Kód banky), without separators or whitespace. + * + * @param bankCode The 4-digit bank code (Kód banky), without separators or whitespace. + * @return the current {@code CZLocalAccountIdentification} instance, allowing for method chaining + */ + public CZLocalAccountIdentification bankCode(String bankCode) { + this.bankCode = bankCode; + isSetBankCode = true; // mark as set + return this; + } + + /** + * The 4-digit bank code (Kód banky), without separators or whitespace. + * + * @return bankCode The 4-digit bank code (Kód banky), without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBankCode() { + return bankCode; + } + + /** + * The 4-digit bank code (Kód banky), without separators or whitespace. + * + * @param bankCode The 4-digit bank code (Kód banky), without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + isSetBankCode = true; // mark as set + } + + /** + * **czLocal** + * + * @param type **czLocal** + * @return the current {@code CZLocalAccountIdentification} instance, allowing for method chaining + */ + public CZLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **czLocal** + * + * @return type **czLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **czLocal** + * + * @param type **czLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CZLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CZLocalAccountIdentification czLocalAccountIdentification = (CZLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, czLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, czLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.bankCode, czLocalAccountIdentification.bankCode) + && Objects.equals(this.isSetBankCode, czLocalAccountIdentification.isSetBankCode) + && Objects.equals(this.type, czLocalAccountIdentification.type) + && Objects.equals(this.isSetType, czLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + bankCode, + isSetBankCode, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CZLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bankCode: ").append(toIndentedString(bankCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("CZLocalAccountIdentification", CZLocalAccountIdentification.class); + JSON.registerDiscriminator(CZLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CZLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of CZLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CZLocalAccountIdentification + */ + public static CZLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CZLocalAccountIdentification.class); + } + + /** + * Convert an instance of CZLocalAccountIdentification 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/capital/Counterparty.java b/src/main/java/com/adyen/model/capital/Counterparty.java new file mode 100644 index 000000000..84cc5ee2c --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Counterparty.java @@ -0,0 +1,308 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Counterparty */ +@JsonPropertyOrder({ + Counterparty.JSON_PROPERTY_ACCOUNT_HOLDER_ID, + Counterparty.JSON_PROPERTY_BALANCE_ACCOUNT_ID, + Counterparty.JSON_PROPERTY_TRANSFER_INSTRUMENT_ID +}) +public class Counterparty { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; + private String accountHolderId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; + private String balanceAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + private String transferInstrumentId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Counterparty() {} + + /** + * The unique identifier of the account holder that receives the grant. If no + * `balanceAccountId` is provided, the grant funds are disbursed to the primary balance + * account of this account holder. + * + * @param accountHolderId The unique identifier of the account holder that receives the grant. If + * no `balanceAccountId` is provided, the grant funds are disbursed to the primary + * balance account of this account holder. + * @return the current {@code Counterparty} instance, allowing for method chaining + */ + public Counterparty accountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set + return this; + } + + /** + * The unique identifier of the account holder that receives the grant. If no + * `balanceAccountId` is provided, the grant funds are disbursed to the primary balance + * account of this account holder. + * + * @return accountHolderId The unique identifier of the account holder that receives the grant. If + * no `balanceAccountId` is provided, the grant funds are disbursed to the primary + * balance account of this account holder. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountHolderId() { + return accountHolderId; + } + + /** + * The unique identifier of the account holder that receives the grant. If no + * `balanceAccountId` is provided, the grant funds are disbursed to the primary balance + * account of this account holder. + * + * @param accountHolderId The unique identifier of the account holder that receives the grant. If + * no `balanceAccountId` is provided, the grant funds are disbursed to the primary + * balance account of this account holder. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set + } + + /** + * The unique identifier of the balance account where the funds are disbursed. The balance account + * must belong to the specified account holder. + * + * @param balanceAccountId The unique identifier of the balance account where the funds are + * disbursed. The balance account must belong to the specified account holder. + * @return the current {@code Counterparty} instance, allowing for method chaining + */ + public Counterparty balanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set + return this; + } + + /** + * The unique identifier of the balance account where the funds are disbursed. The balance account + * must belong to the specified account holder. + * + * @return balanceAccountId The unique identifier of the balance account where the funds are + * disbursed. The balance account must belong to the specified account holder. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBalanceAccountId() { + return balanceAccountId; + } + + /** + * The unique identifier of the balance account where the funds are disbursed. The balance account + * must belong to the specified account holder. + * + * @param balanceAccountId The unique identifier of the balance account where the funds are + * disbursed. The balance account must belong to the specified account holder. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set + } + + /** + * The unique identifier of the transfer instrument where the funds are disbursed. The transfer + * instrument must belong to the legal entity of the specified account holder. + * + * @param transferInstrumentId The unique identifier of the transfer instrument where the funds + * are disbursed. The transfer instrument must belong to the legal entity of the specified + * account holder. + * @return the current {@code Counterparty} instance, allowing for method chaining + */ + public Counterparty transferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + return this; + } + + /** + * The unique identifier of the transfer instrument where the funds are disbursed. The transfer + * instrument must belong to the legal entity of the specified account holder. + * + * @return transferInstrumentId The unique identifier of the transfer instrument where the funds + * are disbursed. The transfer instrument must belong to the legal entity of the specified + * account holder. + */ + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransferInstrumentId() { + return transferInstrumentId; + } + + /** + * The unique identifier of the transfer instrument where the funds are disbursed. The transfer + * instrument must belong to the legal entity of the specified account holder. + * + * @param transferInstrumentId The unique identifier of the transfer instrument where the funds + * are disbursed. The transfer instrument must belong to the legal entity of the specified + * account holder. + */ + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Counterparty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Counterparty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Counterparty counterparty = (Counterparty) o; + return Objects.equals(this.accountHolderId, counterparty.accountHolderId) + && Objects.equals(this.isSetAccountHolderId, counterparty.isSetAccountHolderId) + && Objects.equals(this.balanceAccountId, counterparty.balanceAccountId) + && Objects.equals(this.isSetBalanceAccountId, counterparty.isSetBalanceAccountId) + && Objects.equals(this.transferInstrumentId, counterparty.transferInstrumentId) + && Objects.equals(this.isSetTransferInstrumentId, counterparty.isSetTransferInstrumentId); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolderId, + isSetAccountHolderId, + balanceAccountId, + isSetBalanceAccountId, + transferInstrumentId, + isSetTransferInstrumentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Counterparty {\n"); + sb.append(" accountHolderId: ").append(toIndentedString(accountHolderId)).append("\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" transferInstrumentId: ") + .append(toIndentedString(transferInstrumentId)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Counterparty given an JSON string + * + * @param jsonString JSON string + * @return An instance of Counterparty + * @throws JsonProcessingException if the JSON string is invalid with respect to Counterparty + */ + public static Counterparty fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Counterparty.class); + } + + /** + * Convert an instance of Counterparty 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/capital/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/DKLocalAccountIdentification.java new file mode 100644 index 000000000..24ccb536c --- /dev/null +++ b/src/main/java/com/adyen/model/capital/DKLocalAccountIdentification.java @@ -0,0 +1,308 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** DKLocalAccountIdentification */ +@JsonPropertyOrder({ + DKLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + DKLocalAccountIdentification.JSON_PROPERTY_BANK_CODE, + DKLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class DKLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; + private String bankCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DKLocalAccountIdentification() {} + + /** + * The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). + * + * @param accountNumber The 4-10 digits bank account number (Kontonummer) (without separators or + * whitespace). + * @return the current {@code DKLocalAccountIdentification} instance, allowing for method chaining + */ + public DKLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). + * + * @return accountNumber The 4-10 digits bank account number (Kontonummer) (without separators or + * whitespace). + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). + * + * @param accountNumber The 4-10 digits bank account number (Kontonummer) (without separators or + * whitespace). + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * + * @param bankCode The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * @return the current {@code DKLocalAccountIdentification} instance, allowing for method chaining + */ + public DKLocalAccountIdentification bankCode(String bankCode) { + this.bankCode = bankCode; + isSetBankCode = true; // mark as set + return this; + } + + /** + * The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * + * @return bankCode The 4-digit bank code (Registreringsnummer) (without separators or + * whitespace). + */ + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBankCode() { + return bankCode; + } + + /** + * The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * + * @param bankCode The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + */ + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + isSetBankCode = true; // mark as set + } + + /** + * **dkLocal** + * + * @param type **dkLocal** + * @return the current {@code DKLocalAccountIdentification} instance, allowing for method chaining + */ + public DKLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **dkLocal** + * + * @return type **dkLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **dkLocal** + * + * @param type **dkLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DKLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DKLocalAccountIdentification dkLocalAccountIdentification = (DKLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, dkLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, dkLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.bankCode, dkLocalAccountIdentification.bankCode) + && Objects.equals(this.isSetBankCode, dkLocalAccountIdentification.isSetBankCode) + && Objects.equals(this.type, dkLocalAccountIdentification.type) + && Objects.equals(this.isSetType, dkLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + bankCode, + isSetBankCode, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DKLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bankCode: ").append(toIndentedString(bankCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("DKLocalAccountIdentification", DKLocalAccountIdentification.class); + JSON.registerDiscriminator(DKLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DKLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of DKLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DKLocalAccountIdentification + */ + public static DKLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DKLocalAccountIdentification.class); + } + + /** + * Convert an instance of DKLocalAccountIdentification 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/capital/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/capital/DefaultErrorResponseEntity.java new file mode 100644 index 000000000..e19271877 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/DefaultErrorResponseEntity.java @@ -0,0 +1,547 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** Standardized error response following RFC-7807 format */ +@JsonPropertyOrder({ + DefaultErrorResponseEntity.JSON_PROPERTY_DETAIL, + DefaultErrorResponseEntity.JSON_PROPERTY_ERROR_CODE, + DefaultErrorResponseEntity.JSON_PROPERTY_INSTANCE, + DefaultErrorResponseEntity.JSON_PROPERTY_INVALID_FIELDS, + DefaultErrorResponseEntity.JSON_PROPERTY_REQUEST_ID, + DefaultErrorResponseEntity.JSON_PROPERTY_STATUS, + DefaultErrorResponseEntity.JSON_PROPERTY_TITLE, + DefaultErrorResponseEntity.JSON_PROPERTY_TYPE +}) +public class DefaultErrorResponseEntity { + public static final String JSON_PROPERTY_DETAIL = "detail"; + private String detail; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; + private String errorCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + + public static final String JSON_PROPERTY_INSTANCE = "instance"; + private String instance; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; + private List invalidFields; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; + private String requestId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Integer status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DefaultErrorResponseEntity() {} + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity detail(String detail) { + this.detail = detail; + isSetDetail = true; // mark as set + return this; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @return detail A human-readable explanation specific to this occurrence of the problem. + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetail() { + return detail; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(String detail) { + this.detail = detail; + isSetDetail = true; // mark as set + } + + /** + * Unique business error code. + * + * @param errorCode Unique business error code. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity errorCode(String errorCode) { + this.errorCode = errorCode; + isSetErrorCode = true; // mark as set + return this; + } + + /** + * Unique business error code. + * + * @return errorCode Unique business error code. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorCode() { + return errorCode; + } + + /** + * Unique business error code. + * + * @param errorCode Unique business error code. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + isSetErrorCode = true; // mark as set + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @param instance A URI that identifies the specific occurrence of the problem if applicable. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity instance(String instance) { + this.instance = instance; + isSetInstance = true; // mark as set + return this; + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @return instance A URI that identifies the specific occurrence of the problem if applicable. + */ + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstance() { + return instance; + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @param instance A URI that identifies the specific occurrence of the problem if applicable. + */ + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstance(String instance) { + this.instance = instance; + isSetInstance = true; // mark as set + } + + /** + * Array of fields with validation errors when applicable. + * + * @param invalidFields Array of fields with validation errors when applicable. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity invalidFields(List invalidFields) { + this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set + return this; + } + + public DefaultErrorResponseEntity addInvalidFieldsItem(InvalidField invalidFieldsItem) { + if (this.invalidFields == null) { + this.invalidFields = new ArrayList<>(); + } + this.invalidFields.add(invalidFieldsItem); + return this; + } + + /** + * Array of fields with validation errors when applicable. + * + * @return invalidFields Array of fields with validation errors when applicable. + */ + @JsonProperty(JSON_PROPERTY_INVALID_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInvalidFields() { + return invalidFields; + } + + /** + * Array of fields with validation errors when applicable. + * + * @param invalidFields Array of fields with validation errors when applicable. + */ + @JsonProperty(JSON_PROPERTY_INVALID_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvalidFields(List invalidFields) { + this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set + } + + /** + * The unique reference for the request. + * + * @param requestId The unique reference for the request. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity requestId(String requestId) { + this.requestId = requestId; + isSetRequestId = true; // mark as set + return this; + } + + /** + * The unique reference for the request. + * + * @return requestId The unique reference for the request. + */ + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestId() { + return requestId; + } + + /** + * The unique reference for the request. + * + * @param requestId The unique reference for the request. + */ + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestId(String requestId) { + this.requestId = requestId; + isSetRequestId = true; // mark as set + } + + /** + * The HTTP status code. + * + * @param status The HTTP status code. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity status(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * The HTTP status code. + * + * @return status The HTTP status code. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStatus() { + return status; + } + + /** + * The HTTP status code. + * + * @param status The HTTP status code. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * A short, human-readable summary of the problem type. + * + * @param title A short, human-readable summary of the problem type. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity title(String title) { + this.title = title; + isSetTitle = true; // mark as set + return this; + } + + /** + * A short, human-readable summary of the problem type. + * + * @return title A short, human-readable summary of the problem type. + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + /** + * A short, human-readable summary of the problem type. + * + * @param title A short, human-readable summary of the problem type. + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + isSetTitle = true; // mark as set + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @param type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @return type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @param type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DefaultErrorResponseEntity object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultErrorResponseEntity defaultErrorResponseEntity = (DefaultErrorResponseEntity) o; + return Objects.equals(this.detail, defaultErrorResponseEntity.detail) + && Objects.equals(this.isSetDetail, defaultErrorResponseEntity.isSetDetail) + && Objects.equals(this.errorCode, defaultErrorResponseEntity.errorCode) + && Objects.equals(this.isSetErrorCode, defaultErrorResponseEntity.isSetErrorCode) + && Objects.equals(this.instance, defaultErrorResponseEntity.instance) + && Objects.equals(this.isSetInstance, defaultErrorResponseEntity.isSetInstance) + && Objects.equals(this.invalidFields, defaultErrorResponseEntity.invalidFields) + && Objects.equals(this.isSetInvalidFields, defaultErrorResponseEntity.isSetInvalidFields) + && Objects.equals(this.requestId, defaultErrorResponseEntity.requestId) + && Objects.equals(this.isSetRequestId, defaultErrorResponseEntity.isSetRequestId) + && Objects.equals(this.status, defaultErrorResponseEntity.status) + && Objects.equals(this.isSetStatus, defaultErrorResponseEntity.isSetStatus) + && Objects.equals(this.title, defaultErrorResponseEntity.title) + && Objects.equals(this.isSetTitle, defaultErrorResponseEntity.isSetTitle) + && Objects.equals(this.type, defaultErrorResponseEntity.type) + && Objects.equals(this.isSetType, defaultErrorResponseEntity.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash( + detail, + isSetDetail, + errorCode, + isSetErrorCode, + instance, + isSetInstance, + invalidFields, + isSetInvalidFields, + requestId, + isSetRequestId, + status, + isSetStatus, + title, + isSetTitle, + type, + isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultErrorResponseEntity {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" invalidFields: ").append(toIndentedString(invalidFields)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DefaultErrorResponseEntity given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultErrorResponseEntity + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DefaultErrorResponseEntity + */ + public static DefaultErrorResponseEntity fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DefaultErrorResponseEntity.class); + } + + /** + * Convert an instance of DefaultErrorResponseEntity to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/capital/Disbursement.java b/src/main/java/com/adyen/model/capital/Disbursement.java new file mode 100644 index 000000000..27f37dd0b --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Disbursement.java @@ -0,0 +1,598 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** Disbursement */ +@JsonPropertyOrder({ + Disbursement.JSON_PROPERTY_ACCOUNT_HOLDER_ID, + Disbursement.JSON_PROPERTY_AMOUNT, + Disbursement.JSON_PROPERTY_BALANCE_ACCOUNT_ID, + Disbursement.JSON_PROPERTY_BALANCES, + Disbursement.JSON_PROPERTY_FEE, + Disbursement.JSON_PROPERTY_FUNDS_COLLECTIONS, + Disbursement.JSON_PROPERTY_GRANT_ID, + Disbursement.JSON_PROPERTY_ID, + Disbursement.JSON_PROPERTY_REPAYMENT +}) +public class Disbursement { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; + private String accountHolderId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; + private String balanceAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + + public static final String JSON_PROPERTY_BALANCES = "balances"; + private Balance balances; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + + public static final String JSON_PROPERTY_FEE = "fee"; + private Fee fee; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + + public static final String JSON_PROPERTY_FUNDS_COLLECTIONS = "fundsCollections"; + private List fundsCollections; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundsCollections = false; + + public static final String JSON_PROPERTY_GRANT_ID = "grantId"; + private String grantId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantId = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_REPAYMENT = "repayment"; + private DisbursementRepayment repayment; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepayment = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Disbursement() {} + + /** + * The unique identifier of the account holder that received the disbursement. + * + * @param accountHolderId The unique identifier of the account holder that received the + * disbursement. + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement accountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set + return this; + } + + /** + * The unique identifier of the account holder that received the disbursement. + * + * @return accountHolderId The unique identifier of the account holder that received the + * disbursement. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountHolderId() { + return accountHolderId; + } + + /** + * The unique identifier of the account holder that received the disbursement. + * + * @param accountHolderId The unique identifier of the account holder that received the + * disbursement. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set + } + + /** + * amount + * + * @param amount + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * The unique identifier of the balance account that received the disbursement. + * + * @param balanceAccountId The unique identifier of the balance account that received the + * disbursement. + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement balanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set + return this; + } + + /** + * The unique identifier of the balance account that received the disbursement. + * + * @return balanceAccountId The unique identifier of the balance account that received the + * disbursement. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBalanceAccountId() { + return balanceAccountId; + } + + /** + * The unique identifier of the balance account that received the disbursement. + * + * @param balanceAccountId The unique identifier of the balance account that received the + * disbursement. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set + } + + /** + * balances + * + * @param balances + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement balances(Balance balances) { + this.balances = balances; + isSetBalances = true; // mark as set + return this; + } + + /** + * Get balances + * + * @return balances + */ + @JsonProperty(JSON_PROPERTY_BALANCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Balance getBalances() { + return balances; + } + + /** + * balances + * + * @param balances + */ + @JsonProperty(JSON_PROPERTY_BALANCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalances(Balance balances) { + this.balances = balances; + isSetBalances = true; // mark as set + } + + /** + * fee + * + * @param fee + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement fee(Fee fee) { + this.fee = fee; + isSetFee = true; // mark as set + return this; + } + + /** + * Get fee + * + * @return fee + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Fee getFee() { + return fee; + } + + /** + * fee + * + * @param fee + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFee(Fee fee) { + this.fee = fee; + isSetFee = true; // mark as set + } + + /** + * Contains information about the accounts that Adyen uses to collect funds related to repayments. + * + * @param fundsCollections Contains information about the accounts that Adyen uses to collect + * funds related to repayments. + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement fundsCollections(List fundsCollections) { + this.fundsCollections = fundsCollections; + isSetFundsCollections = true; // mark as set + return this; + } + + public Disbursement addFundsCollectionsItem(FundsCollection fundsCollectionsItem) { + if (this.fundsCollections == null) { + this.fundsCollections = new ArrayList<>(); + } + this.fundsCollections.add(fundsCollectionsItem); + return this; + } + + /** + * Contains information about the accounts that Adyen uses to collect funds related to repayments. + * + * @return fundsCollections Contains information about the accounts that Adyen uses to collect + * funds related to repayments. + */ + @JsonProperty(JSON_PROPERTY_FUNDS_COLLECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFundsCollections() { + return fundsCollections; + } + + /** + * Contains information about the accounts that Adyen uses to collect funds related to repayments. + * + * @param fundsCollections Contains information about the accounts that Adyen uses to collect + * funds related to repayments. + */ + @JsonProperty(JSON_PROPERTY_FUNDS_COLLECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFundsCollections(List fundsCollections) { + this.fundsCollections = fundsCollections; + isSetFundsCollections = true; // mark as set + } + + /** + * The unique identifier of the grant related to the disbursement. + * + * @param grantId The unique identifier of the grant related to the disbursement. + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement grantId(String grantId) { + this.grantId = grantId; + isSetGrantId = true; // mark as set + return this; + } + + /** + * The unique identifier of the grant related to the disbursement. + * + * @return grantId The unique identifier of the grant related to the disbursement. + */ + @JsonProperty(JSON_PROPERTY_GRANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGrantId() { + return grantId; + } + + /** + * The unique identifier of the grant related to the disbursement. + * + * @param grantId The unique identifier of the grant related to the disbursement. + */ + @JsonProperty(JSON_PROPERTY_GRANT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrantId(String grantId) { + this.grantId = grantId; + isSetGrantId = true; // mark as set + } + + /** + * The unique identifier of the disbursement. + * + * @param id The unique identifier of the disbursement. + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the disbursement. + * + * @return id The unique identifier of the disbursement. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the disbursement. + * + * @param id The unique identifier of the disbursement. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * repayment + * + * @param repayment + * @return the current {@code Disbursement} instance, allowing for method chaining + */ + public Disbursement repayment(DisbursementRepayment repayment) { + this.repayment = repayment; + isSetRepayment = true; // mark as set + return this; + } + + /** + * Get repayment + * + * @return repayment + */ + @JsonProperty(JSON_PROPERTY_REPAYMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisbursementRepayment getRepayment() { + return repayment; + } + + /** + * repayment + * + * @param repayment + */ + @JsonProperty(JSON_PROPERTY_REPAYMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepayment(DisbursementRepayment repayment) { + this.repayment = repayment; + isSetRepayment = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Disbursement includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Disbursement object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Disbursement disbursement = (Disbursement) o; + return Objects.equals(this.accountHolderId, disbursement.accountHolderId) + && Objects.equals(this.isSetAccountHolderId, disbursement.isSetAccountHolderId) + && Objects.equals(this.amount, disbursement.amount) + && Objects.equals(this.isSetAmount, disbursement.isSetAmount) + && Objects.equals(this.balanceAccountId, disbursement.balanceAccountId) + && Objects.equals(this.isSetBalanceAccountId, disbursement.isSetBalanceAccountId) + && Objects.equals(this.balances, disbursement.balances) + && Objects.equals(this.isSetBalances, disbursement.isSetBalances) + && Objects.equals(this.fee, disbursement.fee) + && Objects.equals(this.isSetFee, disbursement.isSetFee) + && Objects.equals(this.fundsCollections, disbursement.fundsCollections) + && Objects.equals(this.isSetFundsCollections, disbursement.isSetFundsCollections) + && Objects.equals(this.grantId, disbursement.grantId) + && Objects.equals(this.isSetGrantId, disbursement.isSetGrantId) + && Objects.equals(this.id, disbursement.id) + && Objects.equals(this.isSetId, disbursement.isSetId) + && Objects.equals(this.repayment, disbursement.repayment) + && Objects.equals(this.isSetRepayment, disbursement.isSetRepayment); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolderId, + isSetAccountHolderId, + amount, + isSetAmount, + balanceAccountId, + isSetBalanceAccountId, + balances, + isSetBalances, + fee, + isSetFee, + fundsCollections, + isSetFundsCollections, + grantId, + isSetGrantId, + id, + isSetId, + repayment, + isSetRepayment); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Disbursement {\n"); + sb.append(" accountHolderId: ").append(toIndentedString(accountHolderId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" fundsCollections: ").append(toIndentedString(fundsCollections)).append("\n"); + sb.append(" grantId: ").append(toIndentedString(grantId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" repayment: ").append(toIndentedString(repayment)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetFundsCollections) { + addIfNull(nulls, JSON_PROPERTY_FUNDS_COLLECTIONS, this.fundsCollections); + } + if (isSetGrantId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ID, this.grantId); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRepayment) { + addIfNull(nulls, JSON_PROPERTY_REPAYMENT, this.repayment); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Disbursement given an JSON string + * + * @param jsonString JSON string + * @return An instance of Disbursement + * @throws JsonProcessingException if the JSON string is invalid with respect to Disbursement + */ + public static Disbursement fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Disbursement.class); + } + + /** + * Convert an instance of Disbursement 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/capital/DisbursementInfoUpdate.java b/src/main/java/com/adyen/model/capital/DisbursementInfoUpdate.java new file mode 100644 index 000000000..440e8803c --- /dev/null +++ b/src/main/java/com/adyen/model/capital/DisbursementInfoUpdate.java @@ -0,0 +1,176 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** DisbursementInfoUpdate */ +@JsonPropertyOrder({DisbursementInfoUpdate.JSON_PROPERTY_REPAYMENT}) +public class DisbursementInfoUpdate { + public static final String JSON_PROPERTY_REPAYMENT = "repayment"; + private DisbursementRepaymentInfoUpdate repayment; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepayment = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DisbursementInfoUpdate() {} + + /** + * repayment + * + * @param repayment + * @return the current {@code DisbursementInfoUpdate} instance, allowing for method chaining + */ + public DisbursementInfoUpdate repayment(DisbursementRepaymentInfoUpdate repayment) { + this.repayment = repayment; + isSetRepayment = true; // mark as set + return this; + } + + /** + * Get repayment + * + * @return repayment + */ + @JsonProperty(JSON_PROPERTY_REPAYMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisbursementRepaymentInfoUpdate getRepayment() { + return repayment; + } + + /** + * repayment + * + * @param repayment + */ + @JsonProperty(JSON_PROPERTY_REPAYMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepayment(DisbursementRepaymentInfoUpdate repayment) { + this.repayment = repayment; + isSetRepayment = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisbursementInfoUpdate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DisbursementInfoUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisbursementInfoUpdate disbursementInfoUpdate = (DisbursementInfoUpdate) o; + return Objects.equals(this.repayment, disbursementInfoUpdate.repayment) + && Objects.equals(this.isSetRepayment, disbursementInfoUpdate.isSetRepayment); + } + + @Override + public int hashCode() { + return Objects.hash(repayment, isSetRepayment); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisbursementInfoUpdate {\n"); + sb.append(" repayment: ").append(toIndentedString(repayment)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetRepayment) { + addIfNull(nulls, JSON_PROPERTY_REPAYMENT, this.repayment); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DisbursementInfoUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisbursementInfoUpdate + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DisbursementInfoUpdate + */ + public static DisbursementInfoUpdate fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DisbursementInfoUpdate.class); + } + + /** + * Convert an instance of DisbursementInfoUpdate 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/capital/DisbursementRepayment.java b/src/main/java/com/adyen/model/capital/DisbursementRepayment.java new file mode 100644 index 000000000..4f6bbca7c --- /dev/null +++ b/src/main/java/com/adyen/model/capital/DisbursementRepayment.java @@ -0,0 +1,239 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** DisbursementRepayment */ +@JsonPropertyOrder({ + DisbursementRepayment.JSON_PROPERTY_BASIS_POINTS, + DisbursementRepayment.JSON_PROPERTY_UPDATE_DESCRIPTION +}) +public class DisbursementRepayment { + public static final String JSON_PROPERTY_BASIS_POINTS = "basisPoints"; + private Integer basisPoints; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasisPoints = false; + + public static final String JSON_PROPERTY_UPDATE_DESCRIPTION = "updateDescription"; + private String updateDescription; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdateDescription = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DisbursementRepayment() {} + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @param basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * @return the current {@code DisbursementRepayment} instance, allowing for method chaining + */ + public DisbursementRepayment basisPoints(Integer basisPoints) { + this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set + return this; + } + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). minimum: 0 maximum: 10000 + * + * @return basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + */ + @JsonProperty(JSON_PROPERTY_BASIS_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBasisPoints() { + return basisPoints; + } + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @param basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + */ + @JsonProperty(JSON_PROPERTY_BASIS_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBasisPoints(Integer basisPoints) { + this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set + } + + /** + * updateDescription + * + * @param updateDescription + * @return the current {@code DisbursementRepayment} instance, allowing for method chaining + */ + public DisbursementRepayment updateDescription(String updateDescription) { + this.updateDescription = updateDescription; + isSetUpdateDescription = true; // mark as set + return this; + } + + /** + * Get updateDescription + * + * @return updateDescription + */ + @JsonProperty(JSON_PROPERTY_UPDATE_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdateDescription() { + return updateDescription; + } + + /** + * updateDescription + * + * @param updateDescription + */ + @JsonProperty(JSON_PROPERTY_UPDATE_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateDescription(String updateDescription) { + this.updateDescription = updateDescription; + isSetUpdateDescription = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisbursementRepayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DisbursementRepayment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisbursementRepayment disbursementRepayment = (DisbursementRepayment) o; + return Objects.equals(this.basisPoints, disbursementRepayment.basisPoints) + && Objects.equals(this.isSetBasisPoints, disbursementRepayment.isSetBasisPoints) + && Objects.equals(this.updateDescription, disbursementRepayment.updateDescription) + && Objects.equals( + this.isSetUpdateDescription, disbursementRepayment.isSetUpdateDescription); + } + + @Override + public int hashCode() { + return Objects.hash(basisPoints, isSetBasisPoints, updateDescription, isSetUpdateDescription); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisbursementRepayment {\n"); + sb.append(" basisPoints: ").append(toIndentedString(basisPoints)).append("\n"); + sb.append(" updateDescription: ").append(toIndentedString(updateDescription)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBasisPoints) { + addIfNull(nulls, JSON_PROPERTY_BASIS_POINTS, this.basisPoints); + } + if (isSetUpdateDescription) { + addIfNull(nulls, JSON_PROPERTY_UPDATE_DESCRIPTION, this.updateDescription); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DisbursementRepayment given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisbursementRepayment + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DisbursementRepayment + */ + public static DisbursementRepayment fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DisbursementRepayment.class); + } + + /** + * Convert an instance of DisbursementRepayment 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/capital/DisbursementRepaymentInfoUpdate.java b/src/main/java/com/adyen/model/capital/DisbursementRepaymentInfoUpdate.java new file mode 100644 index 000000000..3d2c0c4d9 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/DisbursementRepaymentInfoUpdate.java @@ -0,0 +1,243 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** DisbursementRepaymentInfoUpdate */ +@JsonPropertyOrder({ + DisbursementRepaymentInfoUpdate.JSON_PROPERTY_BASIS_POINTS, + DisbursementRepaymentInfoUpdate.JSON_PROPERTY_UPDATE_DESCRIPTION +}) +public class DisbursementRepaymentInfoUpdate { + public static final String JSON_PROPERTY_BASIS_POINTS = "basisPoints"; + private Integer basisPoints; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasisPoints = false; + + public static final String JSON_PROPERTY_UPDATE_DESCRIPTION = "updateDescription"; + private String updateDescription; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdateDescription = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DisbursementRepaymentInfoUpdate() {} + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @param basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * @return the current {@code DisbursementRepaymentInfoUpdate} instance, allowing for method + * chaining + */ + public DisbursementRepaymentInfoUpdate basisPoints(Integer basisPoints) { + this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set + return this; + } + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). minimum: 0 maximum: 10000 + * + * @return basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + */ + @JsonProperty(JSON_PROPERTY_BASIS_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBasisPoints() { + return basisPoints; + } + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @param basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + */ + @JsonProperty(JSON_PROPERTY_BASIS_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBasisPoints(Integer basisPoints) { + this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set + } + + /** + * updateDescription + * + * @param updateDescription + * @return the current {@code DisbursementRepaymentInfoUpdate} instance, allowing for method + * chaining + */ + public DisbursementRepaymentInfoUpdate updateDescription(String updateDescription) { + this.updateDescription = updateDescription; + isSetUpdateDescription = true; // mark as set + return this; + } + + /** + * Get updateDescription + * + * @return updateDescription + */ + @JsonProperty(JSON_PROPERTY_UPDATE_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdateDescription() { + return updateDescription; + } + + /** + * updateDescription + * + * @param updateDescription + */ + @JsonProperty(JSON_PROPERTY_UPDATE_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdateDescription(String updateDescription) { + this.updateDescription = updateDescription; + isSetUpdateDescription = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisbursementRepaymentInfoUpdate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DisbursementRepaymentInfoUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DisbursementRepaymentInfoUpdate disbursementRepaymentInfoUpdate = + (DisbursementRepaymentInfoUpdate) o; + return Objects.equals(this.basisPoints, disbursementRepaymentInfoUpdate.basisPoints) + && Objects.equals(this.isSetBasisPoints, disbursementRepaymentInfoUpdate.isSetBasisPoints) + && Objects.equals(this.updateDescription, disbursementRepaymentInfoUpdate.updateDescription) + && Objects.equals( + this.isSetUpdateDescription, disbursementRepaymentInfoUpdate.isSetUpdateDescription); + } + + @Override + public int hashCode() { + return Objects.hash(basisPoints, isSetBasisPoints, updateDescription, isSetUpdateDescription); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DisbursementRepaymentInfoUpdate {\n"); + sb.append(" basisPoints: ").append(toIndentedString(basisPoints)).append("\n"); + sb.append(" updateDescription: ").append(toIndentedString(updateDescription)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBasisPoints) { + addIfNull(nulls, JSON_PROPERTY_BASIS_POINTS, this.basisPoints); + } + if (isSetUpdateDescription) { + addIfNull(nulls, JSON_PROPERTY_UPDATE_DESCRIPTION, this.updateDescription); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DisbursementRepaymentInfoUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of DisbursementRepaymentInfoUpdate + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DisbursementRepaymentInfoUpdate + */ + public static DisbursementRepaymentInfoUpdate fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DisbursementRepaymentInfoUpdate.class); + } + + /** + * Convert an instance of DisbursementRepaymentInfoUpdate 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/capital/Disbursements.java b/src/main/java/com/adyen/model/capital/Disbursements.java new file mode 100644 index 000000000..1b626f641 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Disbursements.java @@ -0,0 +1,185 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** Disbursements */ +@JsonPropertyOrder({Disbursements.JSON_PROPERTY_DISBURSEMENTS}) +public class Disbursements { + public static final String JSON_PROPERTY_DISBURSEMENTS = "disbursements"; + private List disbursements; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisbursements = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Disbursements() {} + + /** + * Contains a list of all disbursements related to the specified grant. + * + * @param disbursements Contains a list of all disbursements related to the specified grant. + * @return the current {@code Disbursements} instance, allowing for method chaining + */ + public Disbursements disbursements(List disbursements) { + this.disbursements = disbursements; + isSetDisbursements = true; // mark as set + return this; + } + + public Disbursements addDisbursementsItem(Disbursement disbursementsItem) { + if (this.disbursements == null) { + this.disbursements = new ArrayList<>(); + } + this.disbursements.add(disbursementsItem); + return this; + } + + /** + * Contains a list of all disbursements related to the specified grant. + * + * @return disbursements Contains a list of all disbursements related to the specified grant. + */ + @JsonProperty(JSON_PROPERTY_DISBURSEMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDisbursements() { + return disbursements; + } + + /** + * Contains a list of all disbursements related to the specified grant. + * + * @param disbursements Contains a list of all disbursements related to the specified grant. + */ + @JsonProperty(JSON_PROPERTY_DISBURSEMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisbursements(List disbursements) { + this.disbursements = disbursements; + isSetDisbursements = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Disbursements includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Disbursements object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Disbursements disbursements = (Disbursements) o; + return Objects.equals(this.disbursements, disbursements.disbursements) + && Objects.equals(this.isSetDisbursements, disbursements.isSetDisbursements); + } + + @Override + public int hashCode() { + return Objects.hash(disbursements, isSetDisbursements); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Disbursements {\n"); + sb.append(" disbursements: ").append(toIndentedString(disbursements)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDisbursements) { + addIfNull(nulls, JSON_PROPERTY_DISBURSEMENTS, this.disbursements); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Disbursements given an JSON string + * + * @param jsonString JSON string + * @return An instance of Disbursements + * @throws JsonProcessingException if the JSON string is invalid with respect to Disbursements + */ + public static Disbursements fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Disbursements.class); + } + + /** + * Convert an instance of Disbursements 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/capital/Fee.java b/src/main/java/com/adyen/model/capital/Fee.java new file mode 100644 index 000000000..d4457fac7 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Fee.java @@ -0,0 +1,175 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Fee */ +@JsonPropertyOrder({Fee.JSON_PROPERTY_AMOUNT}) +public class Fee { + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Fee() {} + + /** + * amount + * + * @param amount + * @return the current {@code Fee} instance, allowing for method chaining + */ + public Fee amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Fee includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Fee object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Fee fee = (Fee) o; + return Objects.equals(this.amount, fee.amount) + && Objects.equals(this.isSetAmount, fee.isSetAmount); + } + + @Override + public int hashCode() { + return Objects.hash(amount, isSetAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Fee {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Fee given an JSON string + * + * @param jsonString JSON string + * @return An instance of Fee + * @throws JsonProcessingException if the JSON string is invalid with respect to Fee + */ + public static Fee fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Fee.class); + } + + /** + * Convert an instance of Fee 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/capital/FundsCollection.java b/src/main/java/com/adyen/model/capital/FundsCollection.java new file mode 100644 index 000000000..1a2ea9e70 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/FundsCollection.java @@ -0,0 +1,234 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** FundsCollection */ +@JsonPropertyOrder({ + FundsCollection.JSON_PROPERTY_ACCOUNT_IDENTIFICATION, + FundsCollection.JSON_PROPERTY_FUNDS_COLLECTION_TYPE +}) +public class FundsCollection { + public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; + private BankAccountIdentification accountIdentification; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + public static final String JSON_PROPERTY_FUNDS_COLLECTION_TYPE = "fundsCollectionType"; + private FundsCollectionType fundsCollectionType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundsCollectionType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public FundsCollection() {} + + /** + * accountIdentification + * + * @param accountIdentification + * @return the current {@code FundsCollection} instance, allowing for method chaining + */ + public FundsCollection accountIdentification(BankAccountIdentification accountIdentification) { + this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + return this; + } + + /** + * Get accountIdentification + * + * @return accountIdentification + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BankAccountIdentification getAccountIdentification() { + return accountIdentification; + } + + /** + * accountIdentification + * + * @param accountIdentification + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountIdentification(BankAccountIdentification accountIdentification) { + this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * fundsCollectionType + * + * @param fundsCollectionType + * @return the current {@code FundsCollection} instance, allowing for method chaining + */ + public FundsCollection fundsCollectionType(FundsCollectionType fundsCollectionType) { + this.fundsCollectionType = fundsCollectionType; + isSetFundsCollectionType = true; // mark as set + return this; + } + + /** + * Get fundsCollectionType + * + * @return fundsCollectionType + */ + @JsonProperty(JSON_PROPERTY_FUNDS_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FundsCollectionType getFundsCollectionType() { + return fundsCollectionType; + } + + /** + * fundsCollectionType + * + * @param fundsCollectionType + */ + @JsonProperty(JSON_PROPERTY_FUNDS_COLLECTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFundsCollectionType(FundsCollectionType fundsCollectionType) { + this.fundsCollectionType = fundsCollectionType; + isSetFundsCollectionType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundsCollection includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this FundsCollection object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FundsCollection fundsCollection = (FundsCollection) o; + return Objects.equals(this.accountIdentification, fundsCollection.accountIdentification) + && Objects.equals( + this.isSetAccountIdentification, fundsCollection.isSetAccountIdentification) + && Objects.equals(this.fundsCollectionType, fundsCollection.fundsCollectionType) + && Objects.equals(this.isSetFundsCollectionType, fundsCollection.isSetFundsCollectionType); + } + + @Override + public int hashCode() { + return Objects.hash( + accountIdentification, + isSetAccountIdentification, + fundsCollectionType, + isSetFundsCollectionType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FundsCollection {\n"); + sb.append(" accountIdentification: ") + .append(toIndentedString(accountIdentification)) + .append("\n"); + sb.append(" fundsCollectionType: ") + .append(toIndentedString(fundsCollectionType)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + if (isSetFundsCollectionType) { + addIfNull(nulls, JSON_PROPERTY_FUNDS_COLLECTION_TYPE, this.fundsCollectionType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of FundsCollection given an JSON string + * + * @param jsonString JSON string + * @return An instance of FundsCollection + * @throws JsonProcessingException if the JSON string is invalid with respect to FundsCollection + */ + public static FundsCollection fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, FundsCollection.class); + } + + /** + * Convert an instance of FundsCollection 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/capital/FundsCollectionType.java b/src/main/java/com/adyen/model/capital/FundsCollectionType.java new file mode 100644 index 000000000..9ca548f92 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/FundsCollectionType.java @@ -0,0 +1,49 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets FundsCollectionType */ +public enum FundsCollectionType { + UNSCHEDULEDREPAYMENT("UnscheduledRepayment"), + + REVOCATION("Revocation"); + + private String value; + + FundsCollectionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FundsCollectionType fromValue(String value) { + for (FundsCollectionType b : FundsCollectionType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/model/capital/Grant.java b/src/main/java/com/adyen/model/capital/Grant.java new file mode 100644 index 000000000..2171905db --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Grant.java @@ -0,0 +1,485 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Grant */ +@JsonPropertyOrder({ + Grant.JSON_PROPERTY_AMOUNT, + Grant.JSON_PROPERTY_BALANCES, + Grant.JSON_PROPERTY_COUNTERPARTY, + Grant.JSON_PROPERTY_GRANT_ACCOUNT_ID, + Grant.JSON_PROPERTY_GRANT_OFFER_ID, + Grant.JSON_PROPERTY_ID, + Grant.JSON_PROPERTY_STATUS +}) +public class Grant { + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + public static final String JSON_PROPERTY_BALANCES = "balances"; + private Balance balances; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; + private Counterparty counterparty; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + + public static final String JSON_PROPERTY_GRANT_ACCOUNT_ID = "grantAccountId"; + private String grantAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantAccountId = false; + + public static final String JSON_PROPERTY_GRANT_OFFER_ID = "grantOfferId"; + private String grantOfferId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOfferId = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Status status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Grant() {} + + /** + * amount + * + * @param amount + * @return the current {@code Grant} instance, allowing for method chaining + */ + public Grant amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * balances + * + * @param balances + * @return the current {@code Grant} instance, allowing for method chaining + */ + public Grant balances(Balance balances) { + this.balances = balances; + isSetBalances = true; // mark as set + return this; + } + + /** + * Get balances + * + * @return balances + */ + @JsonProperty(JSON_PROPERTY_BALANCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Balance getBalances() { + return balances; + } + + /** + * balances + * + * @param balances + */ + @JsonProperty(JSON_PROPERTY_BALANCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalances(Balance balances) { + this.balances = balances; + isSetBalances = true; // mark as set + } + + /** + * counterparty + * + * @param counterparty + * @return the current {@code Grant} instance, allowing for method chaining + */ + public Grant counterparty(Counterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + return this; + } + + /** + * Get counterparty + * + * @return counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Counterparty getCounterparty() { + return counterparty; + } + + /** + * counterparty + * + * @param counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCounterparty(Counterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + } + + /** + * The unique identifier of the grant account that tracks this grant. + * + * @param grantAccountId The unique identifier of the grant account that tracks this grant. + * @return the current {@code Grant} instance, allowing for method chaining + */ + public Grant grantAccountId(String grantAccountId) { + this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set + return this; + } + + /** + * The unique identifier of the grant account that tracks this grant. + * + * @return grantAccountId The unique identifier of the grant account that tracks this grant. + */ + @JsonProperty(JSON_PROPERTY_GRANT_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGrantAccountId() { + return grantAccountId; + } + + /** + * The unique identifier of the grant account that tracks this grant. + * + * @param grantAccountId The unique identifier of the grant account that tracks this grant. + */ + @JsonProperty(JSON_PROPERTY_GRANT_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrantAccountId(String grantAccountId) { + this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set + } + + /** + * The unique identifier of the selected grant offer. Adyen uses the details of the selected grant + * offer to create a grant. + * + * @param grantOfferId The unique identifier of the selected grant offer. Adyen uses the details + * of the selected grant offer to create a grant. + * @return the current {@code Grant} instance, allowing for method chaining + */ + public Grant grantOfferId(String grantOfferId) { + this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set + return this; + } + + /** + * The unique identifier of the selected grant offer. Adyen uses the details of the selected grant + * offer to create a grant. + * + * @return grantOfferId The unique identifier of the selected grant offer. Adyen uses the details + * of the selected grant offer to create a grant. + */ + @JsonProperty(JSON_PROPERTY_GRANT_OFFER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGrantOfferId() { + return grantOfferId; + } + + /** + * The unique identifier of the selected grant offer. Adyen uses the details of the selected grant + * offer to create a grant. + * + * @param grantOfferId The unique identifier of the selected grant offer. Adyen uses the details + * of the selected grant offer to create a grant. + */ + @JsonProperty(JSON_PROPERTY_GRANT_OFFER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrantOfferId(String grantOfferId) { + this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set + } + + /** + * The unique identifier of the grant reference. + * + * @param id The unique identifier of the grant reference. + * @return the current {@code Grant} instance, allowing for method chaining + */ + public Grant id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the grant reference. + * + * @return id The unique identifier of the grant reference. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the grant reference. + * + * @param id The unique identifier of the grant reference. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * status + * + * @param status + * @return the current {@code Grant} instance, allowing for method chaining + */ + public Grant status(Status status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * Get status + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Status getStatus() { + return status; + } + + /** + * status + * + * @param status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(Status status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Grant includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Grant object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Grant grant = (Grant) o; + return Objects.equals(this.amount, grant.amount) + && Objects.equals(this.isSetAmount, grant.isSetAmount) + && Objects.equals(this.balances, grant.balances) + && Objects.equals(this.isSetBalances, grant.isSetBalances) + && Objects.equals(this.counterparty, grant.counterparty) + && Objects.equals(this.isSetCounterparty, grant.isSetCounterparty) + && Objects.equals(this.grantAccountId, grant.grantAccountId) + && Objects.equals(this.isSetGrantAccountId, grant.isSetGrantAccountId) + && Objects.equals(this.grantOfferId, grant.grantOfferId) + && Objects.equals(this.isSetGrantOfferId, grant.isSetGrantOfferId) + && Objects.equals(this.id, grant.id) + && Objects.equals(this.isSetId, grant.isSetId) + && Objects.equals(this.status, grant.status) + && Objects.equals(this.isSetStatus, grant.isSetStatus); + } + + @Override + public int hashCode() { + return Objects.hash( + amount, + isSetAmount, + balances, + isSetBalances, + counterparty, + isSetCounterparty, + grantAccountId, + isSetGrantAccountId, + grantOfferId, + isSetGrantOfferId, + id, + isSetId, + status, + isSetStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Grant {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" grantAccountId: ").append(toIndentedString(grantAccountId)).append("\n"); + sb.append(" grantOfferId: ").append(toIndentedString(grantOfferId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetGrantAccountId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ACCOUNT_ID, this.grantAccountId); + } + if (isSetGrantOfferId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFER_ID, this.grantOfferId); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Grant given an JSON string + * + * @param jsonString JSON string + * @return An instance of Grant + * @throws JsonProcessingException if the JSON string is invalid with respect to Grant + */ + public static Grant fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Grant.class); + } + + /** + * Convert an instance of Grant 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/capital/GrantAccount.java b/src/main/java/com/adyen/model/capital/GrantAccount.java new file mode 100644 index 000000000..963f71185 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/GrantAccount.java @@ -0,0 +1,359 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** GrantAccount */ +@JsonPropertyOrder({ + GrantAccount.JSON_PROPERTY_BALANCES, + GrantAccount.JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID, + GrantAccount.JSON_PROPERTY_ID, + GrantAccount.JSON_PROPERTY_LIMITS +}) +public class GrantAccount { + public static final String JSON_PROPERTY_BALANCES = "balances"; + private List balances; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + + public static final String JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID = "fundingBalanceAccountId"; + private String fundingBalanceAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingBalanceAccountId = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_LIMITS = "limits"; + private List limits; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLimits = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GrantAccount() {} + + /** + * Contains the sum of the balances of all grants tracked by this grant account. The balances are + * separated by currency. + * + * @param balances Contains the sum of the balances of all grants tracked by this grant account. + * The balances are separated by currency. + * @return the current {@code GrantAccount} instance, allowing for method chaining + */ + public GrantAccount balances(List balances) { + this.balances = balances; + isSetBalances = true; // mark as set + return this; + } + + public GrantAccount addBalancesItem(Balance balancesItem) { + if (this.balances == null) { + this.balances = new ArrayList<>(); + } + this.balances.add(balancesItem); + return this; + } + + /** + * Contains the sum of the balances of all grants tracked by this grant account. The balances are + * separated by currency. + * + * @return balances Contains the sum of the balances of all grants tracked by this grant account. + * The balances are separated by currency. + */ + @JsonProperty(JSON_PROPERTY_BALANCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBalances() { + return balances; + } + + /** + * Contains the sum of the balances of all grants tracked by this grant account. The balances are + * separated by currency. + * + * @param balances Contains the sum of the balances of all grants tracked by this grant account. + * The balances are separated by currency. + */ + @JsonProperty(JSON_PROPERTY_BALANCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalances(List balances) { + this.balances = balances; + isSetBalances = true; // mark as set + } + + /** + * The unique identifier of the balance account used to fund the grant. + * + * @param fundingBalanceAccountId The unique identifier of the balance account used to fund the + * grant. + * @return the current {@code GrantAccount} instance, allowing for method chaining + */ + public GrantAccount fundingBalanceAccountId(String fundingBalanceAccountId) { + this.fundingBalanceAccountId = fundingBalanceAccountId; + isSetFundingBalanceAccountId = true; // mark as set + return this; + } + + /** + * The unique identifier of the balance account used to fund the grant. + * + * @return fundingBalanceAccountId The unique identifier of the balance account used to fund the + * grant. + */ + @JsonProperty(JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFundingBalanceAccountId() { + return fundingBalanceAccountId; + } + + /** + * The unique identifier of the balance account used to fund the grant. + * + * @param fundingBalanceAccountId The unique identifier of the balance account used to fund the + * grant. + */ + @JsonProperty(JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFundingBalanceAccountId(String fundingBalanceAccountId) { + this.fundingBalanceAccountId = fundingBalanceAccountId; + isSetFundingBalanceAccountId = true; // mark as set + } + + /** + * The unique identifier of the grant account. + * + * @param id The unique identifier of the grant account. + * @return the current {@code GrantAccount} instance, allowing for method chaining + */ + public GrantAccount id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the grant account. + * + * @return id The unique identifier of the grant account. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the grant account. + * + * @param id The unique identifier of the grant account. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * Contains the maximum amount of funds that you can disburse for grants. + * + * @param limits Contains the maximum amount of funds that you can disburse for grants. + * @return the current {@code GrantAccount} instance, allowing for method chaining + */ + public GrantAccount limits(List limits) { + this.limits = limits; + isSetLimits = true; // mark as set + return this; + } + + public GrantAccount addLimitsItem(GrantLimit limitsItem) { + if (this.limits == null) { + this.limits = new ArrayList<>(); + } + this.limits.add(limitsItem); + return this; + } + + /** + * Contains the maximum amount of funds that you can disburse for grants. + * + * @return limits Contains the maximum amount of funds that you can disburse for grants. + */ + @JsonProperty(JSON_PROPERTY_LIMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLimits() { + return limits; + } + + /** + * Contains the maximum amount of funds that you can disburse for grants. + * + * @param limits Contains the maximum amount of funds that you can disburse for grants. + */ + @JsonProperty(JSON_PROPERTY_LIMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLimits(List limits) { + this.limits = limits; + isSetLimits = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantAccount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GrantAccount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantAccount grantAccount = (GrantAccount) o; + return Objects.equals(this.balances, grantAccount.balances) + && Objects.equals(this.isSetBalances, grantAccount.isSetBalances) + && Objects.equals(this.fundingBalanceAccountId, grantAccount.fundingBalanceAccountId) + && Objects.equals( + this.isSetFundingBalanceAccountId, grantAccount.isSetFundingBalanceAccountId) + && Objects.equals(this.id, grantAccount.id) + && Objects.equals(this.isSetId, grantAccount.isSetId) + && Objects.equals(this.limits, grantAccount.limits) + && Objects.equals(this.isSetLimits, grantAccount.isSetLimits); + } + + @Override + public int hashCode() { + return Objects.hash( + balances, + isSetBalances, + fundingBalanceAccountId, + isSetFundingBalanceAccountId, + id, + isSetId, + limits, + isSetLimits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantAccount {\n"); + sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); + sb.append(" fundingBalanceAccountId: ") + .append(toIndentedString(fundingBalanceAccountId)) + .append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetFundingBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID, this.fundingBalanceAccountId); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLimits) { + addIfNull(nulls, JSON_PROPERTY_LIMITS, this.limits); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GrantAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantAccount + * @throws JsonProcessingException if the JSON string is invalid with respect to GrantAccount + */ + public static GrantAccount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GrantAccount.class); + } + + /** + * Convert an instance of GrantAccount 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/capital/GrantInfo.java b/src/main/java/com/adyen/model/capital/GrantInfo.java new file mode 100644 index 000000000..256425a7b --- /dev/null +++ b/src/main/java/com/adyen/model/capital/GrantInfo.java @@ -0,0 +1,335 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** GrantInfo */ +@JsonPropertyOrder({ + GrantInfo.JSON_PROPERTY_AMOUNT, + GrantInfo.JSON_PROPERTY_COUNTERPARTY, + GrantInfo.JSON_PROPERTY_GRANT_ACCOUNT_ID, + GrantInfo.JSON_PROPERTY_GRANT_OFFER_ID +}) +public class GrantInfo { + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; + private Counterparty counterparty; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + + public static final String JSON_PROPERTY_GRANT_ACCOUNT_ID = "grantAccountId"; + private String grantAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantAccountId = false; + + public static final String JSON_PROPERTY_GRANT_OFFER_ID = "grantOfferId"; + private String grantOfferId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOfferId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GrantInfo() {} + + /** + * amount + * + * @param amount + * @return the current {@code GrantInfo} instance, allowing for method chaining + */ + public GrantInfo amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * counterparty + * + * @param counterparty + * @return the current {@code GrantInfo} instance, allowing for method chaining + */ + public GrantInfo counterparty(Counterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + return this; + } + + /** + * Get counterparty + * + * @return counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Counterparty getCounterparty() { + return counterparty; + } + + /** + * counterparty + * + * @param counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCounterparty(Counterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + } + + /** + * The unique identifier of the grant account that tracks this grant. + * + * @param grantAccountId The unique identifier of the grant account that tracks this grant. + * @return the current {@code GrantInfo} instance, allowing for method chaining + */ + public GrantInfo grantAccountId(String grantAccountId) { + this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set + return this; + } + + /** + * The unique identifier of the grant account that tracks this grant. + * + * @return grantAccountId The unique identifier of the grant account that tracks this grant. + */ + @JsonProperty(JSON_PROPERTY_GRANT_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGrantAccountId() { + return grantAccountId; + } + + /** + * The unique identifier of the grant account that tracks this grant. + * + * @param grantAccountId The unique identifier of the grant account that tracks this grant. + */ + @JsonProperty(JSON_PROPERTY_GRANT_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrantAccountId(String grantAccountId) { + this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set + } + + /** + * The unique identifier of the selected grant offer. Adyen uses the details of the selected grant + * offer to create a grant. + * + * @param grantOfferId The unique identifier of the selected grant offer. Adyen uses the details + * of the selected grant offer to create a grant. + * @return the current {@code GrantInfo} instance, allowing for method chaining + */ + public GrantInfo grantOfferId(String grantOfferId) { + this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set + return this; + } + + /** + * The unique identifier of the selected grant offer. Adyen uses the details of the selected grant + * offer to create a grant. + * + * @return grantOfferId The unique identifier of the selected grant offer. Adyen uses the details + * of the selected grant offer to create a grant. + */ + @JsonProperty(JSON_PROPERTY_GRANT_OFFER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGrantOfferId() { + return grantOfferId; + } + + /** + * The unique identifier of the selected grant offer. Adyen uses the details of the selected grant + * offer to create a grant. + * + * @param grantOfferId The unique identifier of the selected grant offer. Adyen uses the details + * of the selected grant offer to create a grant. + */ + @JsonProperty(JSON_PROPERTY_GRANT_OFFER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrantOfferId(String grantOfferId) { + this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GrantInfo object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantInfo grantInfo = (GrantInfo) o; + return Objects.equals(this.amount, grantInfo.amount) + && Objects.equals(this.isSetAmount, grantInfo.isSetAmount) + && Objects.equals(this.counterparty, grantInfo.counterparty) + && Objects.equals(this.isSetCounterparty, grantInfo.isSetCounterparty) + && Objects.equals(this.grantAccountId, grantInfo.grantAccountId) + && Objects.equals(this.isSetGrantAccountId, grantInfo.isSetGrantAccountId) + && Objects.equals(this.grantOfferId, grantInfo.grantOfferId) + && Objects.equals(this.isSetGrantOfferId, grantInfo.isSetGrantOfferId); + } + + @Override + public int hashCode() { + return Objects.hash( + amount, + isSetAmount, + counterparty, + isSetCounterparty, + grantAccountId, + isSetGrantAccountId, + grantOfferId, + isSetGrantOfferId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantInfo {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" grantAccountId: ").append(toIndentedString(grantAccountId)).append("\n"); + sb.append(" grantOfferId: ").append(toIndentedString(grantOfferId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetGrantAccountId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ACCOUNT_ID, this.grantAccountId); + } + if (isSetGrantOfferId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFER_ID, this.grantOfferId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GrantInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantInfo + * @throws JsonProcessingException if the JSON string is invalid with respect to GrantInfo + */ + public static GrantInfo fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GrantInfo.class); + } + + /** + * Convert an instance of GrantInfo 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/capital/GrantLimit.java b/src/main/java/com/adyen/model/capital/GrantLimit.java new file mode 100644 index 000000000..288cdb098 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/GrantLimit.java @@ -0,0 +1,175 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** GrantLimit */ +@JsonPropertyOrder({GrantLimit.JSON_PROPERTY_AMOUNT}) +public class GrantLimit { + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GrantLimit() {} + + /** + * amount + * + * @param amount + * @return the current {@code GrantLimit} instance, allowing for method chaining + */ + public GrantLimit amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantLimit includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GrantLimit object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantLimit grantLimit = (GrantLimit) o; + return Objects.equals(this.amount, grantLimit.amount) + && Objects.equals(this.isSetAmount, grantLimit.isSetAmount); + } + + @Override + public int hashCode() { + return Objects.hash(amount, isSetAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantLimit {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GrantLimit given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantLimit + * @throws JsonProcessingException if the JSON string is invalid with respect to GrantLimit + */ + public static GrantLimit fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GrantLimit.class); + } + + /** + * Convert an instance of GrantLimit 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/capital/GrantOffer.java b/src/main/java/com/adyen/model/capital/GrantOffer.java new file mode 100644 index 000000000..8d118734c --- /dev/null +++ b/src/main/java/com/adyen/model/capital/GrantOffer.java @@ -0,0 +1,581 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** GrantOffer */ +@JsonPropertyOrder({ + GrantOffer.JSON_PROPERTY_ACCOUNT_HOLDER_ID, + GrantOffer.JSON_PROPERTY_AMOUNT, + GrantOffer.JSON_PROPERTY_CONTRACT_TYPE, + GrantOffer.JSON_PROPERTY_EXPIRES_AT, + GrantOffer.JSON_PROPERTY_FEE, + GrantOffer.JSON_PROPERTY_ID, + GrantOffer.JSON_PROPERTY_REPAYMENT, + GrantOffer.JSON_PROPERTY_STARTS_AT +}) +public class GrantOffer { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; + private String accountHolderId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. */ + public enum ContractTypeEnum { + CASHADVANCE(String.valueOf("cashAdvance")), + + LOAN(String.valueOf("loan")); + + private static final Logger LOG = Logger.getLogger(ContractTypeEnum.class.getName()); + + private String value; + + ContractTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ContractTypeEnum fromValue(String value) { + for (ContractTypeEnum b : ContractTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "ContractTypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ContractTypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_CONTRACT_TYPE = "contractType"; + private ContractTypeEnum contractType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContractType = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; + private OffsetDateTime expiresAt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + + public static final String JSON_PROPERTY_FEE = "fee"; + private GrantOfferFee fee; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_REPAYMENT = "repayment"; + private Repayment repayment; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepayment = false; + + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; + private OffsetDateTime startsAt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GrantOffer() {} + + /** + * The unique identifier of the account holder to which the grant is offered. + * + * @param accountHolderId The unique identifier of the account holder to which the grant is + * offered. + * @return the current {@code GrantOffer} instance, allowing for method chaining + */ + public GrantOffer accountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set + return this; + } + + /** + * The unique identifier of the account holder to which the grant is offered. + * + * @return accountHolderId The unique identifier of the account holder to which the grant is + * offered. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountHolderId() { + return accountHolderId; + } + + /** + * The unique identifier of the account holder to which the grant is offered. + * + * @param accountHolderId The unique identifier of the account holder to which the grant is + * offered. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set + } + + /** + * amount + * + * @param amount + * @return the current {@code GrantOffer} instance, allowing for method chaining + */ + public GrantOffer amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. + * + * @param contractType The contract type of the grant offer. Possible values: **cashAdvance**, + * **loan**. + * @return the current {@code GrantOffer} instance, allowing for method chaining + */ + public GrantOffer contractType(ContractTypeEnum contractType) { + this.contractType = contractType; + isSetContractType = true; // mark as set + return this; + } + + /** + * The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. + * + * @return contractType The contract type of the grant offer. Possible values: **cashAdvance**, + * **loan**. + */ + @JsonProperty(JSON_PROPERTY_CONTRACT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ContractTypeEnum getContractType() { + return contractType; + } + + /** + * The contract type of the grant offer. Possible values: **cashAdvance**, **loan**. + * + * @param contractType The contract type of the grant offer. Possible values: **cashAdvance**, + * **loan**. + */ + @JsonProperty(JSON_PROPERTY_CONTRACT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContractType(ContractTypeEnum contractType) { + this.contractType = contractType; + isSetContractType = true; // mark as set + } + + /** + * The date when the grant offer expires. + * + * @param expiresAt The date when the grant offer expires. + * @return the current {@code GrantOffer} instance, allowing for method chaining + */ + public GrantOffer expiresAt(OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set + return this; + } + + /** + * The date when the grant offer expires. + * + * @return expiresAt The date when the grant offer expires. + */ + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + /** + * The date when the grant offer expires. + * + * @param expiresAt The date when the grant offer expires. + */ + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set + } + + /** + * fee + * + * @param fee + * @return the current {@code GrantOffer} instance, allowing for method chaining + */ + public GrantOffer fee(GrantOfferFee fee) { + this.fee = fee; + isSetFee = true; // mark as set + return this; + } + + /** + * Get fee + * + * @return fee + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GrantOfferFee getFee() { + return fee; + } + + /** + * fee + * + * @param fee + */ + @JsonProperty(JSON_PROPERTY_FEE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFee(GrantOfferFee fee) { + this.fee = fee; + isSetFee = true; // mark as set + } + + /** + * The unique identifier of the grant offer. + * + * @param id The unique identifier of the grant offer. + * @return the current {@code GrantOffer} instance, allowing for method chaining + */ + public GrantOffer id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the grant offer. + * + * @return id The unique identifier of the grant offer. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the grant offer. + * + * @param id The unique identifier of the grant offer. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * repayment + * + * @param repayment + * @return the current {@code GrantOffer} instance, allowing for method chaining + */ + public GrantOffer repayment(Repayment repayment) { + this.repayment = repayment; + isSetRepayment = true; // mark as set + return this; + } + + /** + * Get repayment + * + * @return repayment + */ + @JsonProperty(JSON_PROPERTY_REPAYMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Repayment getRepayment() { + return repayment; + } + + /** + * repayment + * + * @param repayment + */ + @JsonProperty(JSON_PROPERTY_REPAYMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepayment(Repayment repayment) { + this.repayment = repayment; + isSetRepayment = true; // mark as set + } + + /** + * The date when the grant offer becomes available. + * + * @param startsAt The date when the grant offer becomes available. + * @return the current {@code GrantOffer} instance, allowing for method chaining + */ + public GrantOffer startsAt(OffsetDateTime startsAt) { + this.startsAt = startsAt; + isSetStartsAt = true; // mark as set + return this; + } + + /** + * The date when the grant offer becomes available. + * + * @return startsAt The date when the grant offer becomes available. + */ + @JsonProperty(JSON_PROPERTY_STARTS_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getStartsAt() { + return startsAt; + } + + /** + * The date when the grant offer becomes available. + * + * @param startsAt The date when the grant offer becomes available. + */ + @JsonProperty(JSON_PROPERTY_STARTS_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartsAt(OffsetDateTime startsAt) { + this.startsAt = startsAt; + isSetStartsAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantOffer includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GrantOffer object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantOffer grantOffer = (GrantOffer) o; + return Objects.equals(this.accountHolderId, grantOffer.accountHolderId) + && Objects.equals(this.isSetAccountHolderId, grantOffer.isSetAccountHolderId) + && Objects.equals(this.amount, grantOffer.amount) + && Objects.equals(this.isSetAmount, grantOffer.isSetAmount) + && Objects.equals(this.contractType, grantOffer.contractType) + && Objects.equals(this.isSetContractType, grantOffer.isSetContractType) + && Objects.equals(this.expiresAt, grantOffer.expiresAt) + && Objects.equals(this.isSetExpiresAt, grantOffer.isSetExpiresAt) + && Objects.equals(this.fee, grantOffer.fee) + && Objects.equals(this.isSetFee, grantOffer.isSetFee) + && Objects.equals(this.id, grantOffer.id) + && Objects.equals(this.isSetId, grantOffer.isSetId) + && Objects.equals(this.repayment, grantOffer.repayment) + && Objects.equals(this.isSetRepayment, grantOffer.isSetRepayment) + && Objects.equals(this.startsAt, grantOffer.startsAt) + && Objects.equals(this.isSetStartsAt, grantOffer.isSetStartsAt); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolderId, + isSetAccountHolderId, + amount, + isSetAmount, + contractType, + isSetContractType, + expiresAt, + isSetExpiresAt, + fee, + isSetFee, + id, + isSetId, + repayment, + isSetRepayment, + startsAt, + isSetStartsAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantOffer {\n"); + sb.append(" accountHolderId: ").append(toIndentedString(accountHolderId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" contractType: ").append(toIndentedString(contractType)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" repayment: ").append(toIndentedString(repayment)).append("\n"); + sb.append(" startsAt: ").append(toIndentedString(startsAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetContractType) { + addIfNull(nulls, JSON_PROPERTY_CONTRACT_TYPE, this.contractType); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRepayment) { + addIfNull(nulls, JSON_PROPERTY_REPAYMENT, this.repayment); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GrantOffer given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantOffer + * @throws JsonProcessingException if the JSON string is invalid with respect to GrantOffer + */ + public static GrantOffer fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GrantOffer.class); + } + + /** + * Convert an instance of GrantOffer 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/capital/GrantOfferFee.java b/src/main/java/com/adyen/model/capital/GrantOfferFee.java new file mode 100644 index 000000000..e4a96af9d --- /dev/null +++ b/src/main/java/com/adyen/model/capital/GrantOfferFee.java @@ -0,0 +1,231 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** GrantOfferFee */ +@JsonPropertyOrder({ + GrantOfferFee.JSON_PROPERTY_AMOUNT, + GrantOfferFee.JSON_PROPERTY_APR_BASIS_POINTS +}) +public class GrantOfferFee { + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + public static final String JSON_PROPERTY_APR_BASIS_POINTS = "aprBasisPoints"; + private Integer aprBasisPoints; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAprBasisPoints = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GrantOfferFee() {} + + /** + * amount + * + * @param amount + * @return the current {@code GrantOfferFee} instance, allowing for method chaining + */ + public GrantOfferFee amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Annual Percentage Rate (APR) of the offer. The percentage is expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @param aprBasisPoints Annual Percentage Rate (APR) of the offer. The percentage is expressed in + * [basis points](https://www.investopedia.com/terms/b/basispoint.asp). + * @return the current {@code GrantOfferFee} instance, allowing for method chaining + */ + public GrantOfferFee aprBasisPoints(Integer aprBasisPoints) { + this.aprBasisPoints = aprBasisPoints; + isSetAprBasisPoints = true; // mark as set + return this; + } + + /** + * Annual Percentage Rate (APR) of the offer. The percentage is expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @return aprBasisPoints Annual Percentage Rate (APR) of the offer. The percentage is expressed + * in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). + */ + @JsonProperty(JSON_PROPERTY_APR_BASIS_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAprBasisPoints() { + return aprBasisPoints; + } + + /** + * Annual Percentage Rate (APR) of the offer. The percentage is expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @param aprBasisPoints Annual Percentage Rate (APR) of the offer. The percentage is expressed in + * [basis points](https://www.investopedia.com/terms/b/basispoint.asp). + */ + @JsonProperty(JSON_PROPERTY_APR_BASIS_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAprBasisPoints(Integer aprBasisPoints) { + this.aprBasisPoints = aprBasisPoints; + isSetAprBasisPoints = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantOfferFee includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GrantOfferFee object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantOfferFee grantOfferFee = (GrantOfferFee) o; + return Objects.equals(this.amount, grantOfferFee.amount) + && Objects.equals(this.isSetAmount, grantOfferFee.isSetAmount) + && Objects.equals(this.aprBasisPoints, grantOfferFee.aprBasisPoints) + && Objects.equals(this.isSetAprBasisPoints, grantOfferFee.isSetAprBasisPoints); + } + + @Override + public int hashCode() { + return Objects.hash(amount, isSetAmount, aprBasisPoints, isSetAprBasisPoints); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantOfferFee {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" aprBasisPoints: ").append(toIndentedString(aprBasisPoints)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAprBasisPoints) { + addIfNull(nulls, JSON_PROPERTY_APR_BASIS_POINTS, this.aprBasisPoints); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GrantOfferFee given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantOfferFee + * @throws JsonProcessingException if the JSON string is invalid with respect to GrantOfferFee + */ + public static GrantOfferFee fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GrantOfferFee.class); + } + + /** + * Convert an instance of GrantOfferFee 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/capital/GrantOffers.java b/src/main/java/com/adyen/model/capital/GrantOffers.java new file mode 100644 index 000000000..9bcf10695 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/GrantOffers.java @@ -0,0 +1,185 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** GrantOffers */ +@JsonPropertyOrder({GrantOffers.JSON_PROPERTY_GRANT_OFFERS}) +public class GrantOffers { + public static final String JSON_PROPERTY_GRANT_OFFERS = "grantOffers"; + private List grantOffers; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOffers = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public GrantOffers() {} + + /** + * Contains a list of available grant offers for the specified account holder. + * + * @param grantOffers Contains a list of available grant offers for the specified account holder. + * @return the current {@code GrantOffers} instance, allowing for method chaining + */ + public GrantOffers grantOffers(List grantOffers) { + this.grantOffers = grantOffers; + isSetGrantOffers = true; // mark as set + return this; + } + + public GrantOffers addGrantOffersItem(GrantOffer grantOffersItem) { + if (this.grantOffers == null) { + this.grantOffers = new ArrayList<>(); + } + this.grantOffers.add(grantOffersItem); + return this; + } + + /** + * Contains a list of available grant offers for the specified account holder. + * + * @return grantOffers Contains a list of available grant offers for the specified account holder. + */ + @JsonProperty(JSON_PROPERTY_GRANT_OFFERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGrantOffers() { + return grantOffers; + } + + /** + * Contains a list of available grant offers for the specified account holder. + * + * @param grantOffers Contains a list of available grant offers for the specified account holder. + */ + @JsonProperty(JSON_PROPERTY_GRANT_OFFERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrantOffers(List grantOffers) { + this.grantOffers = grantOffers; + isSetGrantOffers = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantOffers includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this GrantOffers object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantOffers grantOffers = (GrantOffers) o; + return Objects.equals(this.grantOffers, grantOffers.grantOffers) + && Objects.equals(this.isSetGrantOffers, grantOffers.isSetGrantOffers); + } + + @Override + public int hashCode() { + return Objects.hash(grantOffers, isSetGrantOffers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantOffers {\n"); + sb.append(" grantOffers: ").append(toIndentedString(grantOffers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetGrantOffers) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFERS, this.grantOffers); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of GrantOffers given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantOffers + * @throws JsonProcessingException if the JSON string is invalid with respect to GrantOffers + */ + public static GrantOffers fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GrantOffers.class); + } + + /** + * Convert an instance of GrantOffers 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/capital/Grants.java b/src/main/java/com/adyen/model/capital/Grants.java new file mode 100644 index 000000000..a677f9d12 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Grants.java @@ -0,0 +1,185 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** Grants */ +@JsonPropertyOrder({Grants.JSON_PROPERTY_GRANTS}) +public class Grants { + public static final String JSON_PROPERTY_GRANTS = "grants"; + private List grants; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrants = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Grants() {} + + /** + * Contains a list of the grants that the account holder has received. + * + * @param grants Contains a list of the grants that the account holder has received. + * @return the current {@code Grants} instance, allowing for method chaining + */ + public Grants grants(List grants) { + this.grants = grants; + isSetGrants = true; // mark as set + return this; + } + + public Grants addGrantsItem(Grant grantsItem) { + if (this.grants == null) { + this.grants = new ArrayList<>(); + } + this.grants.add(grantsItem); + return this; + } + + /** + * Contains a list of the grants that the account holder has received. + * + * @return grants Contains a list of the grants that the account holder has received. + */ + @JsonProperty(JSON_PROPERTY_GRANTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGrants() { + return grants; + } + + /** + * Contains a list of the grants that the account holder has received. + * + * @param grants Contains a list of the grants that the account holder has received. + */ + @JsonProperty(JSON_PROPERTY_GRANTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGrants(List grants) { + this.grants = grants; + isSetGrants = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Grants includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Grants object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Grants grants = (Grants) o; + return Objects.equals(this.grants, grants.grants) + && Objects.equals(this.isSetGrants, grants.isSetGrants); + } + + @Override + public int hashCode() { + return Objects.hash(grants, isSetGrants); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Grants {\n"); + sb.append(" grants: ").append(toIndentedString(grants)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetGrants) { + addIfNull(nulls, JSON_PROPERTY_GRANTS, this.grants); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Grants given an JSON string + * + * @param jsonString JSON string + * @return An instance of Grants + * @throws JsonProcessingException if the JSON string is invalid with respect to Grants + */ + public static Grants fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Grants.class); + } + + /** + * Convert an instance of Grants 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/capital/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/HKLocalAccountIdentification.java new file mode 100644 index 000000000..8ba49943a --- /dev/null +++ b/src/main/java/com/adyen/model/capital/HKLocalAccountIdentification.java @@ -0,0 +1,310 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** HKLocalAccountIdentification */ +@JsonPropertyOrder({ + HKLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + HKLocalAccountIdentification.JSON_PROPERTY_CLEARING_CODE, + HKLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class HKLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; + private String clearingCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public HKLocalAccountIdentification() {} + + /** + * The 9- to 17-digit bank account number, without separators or whitespace. Starts with the + * 3-digit branch code. + * + * @param accountNumber The 9- to 17-digit bank account number, without separators or whitespace. + * Starts with the 3-digit branch code. + * @return the current {@code HKLocalAccountIdentification} instance, allowing for method chaining + */ + public HKLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 9- to 17-digit bank account number, without separators or whitespace. Starts with the + * 3-digit branch code. + * + * @return accountNumber The 9- to 17-digit bank account number, without separators or whitespace. + * Starts with the 3-digit branch code. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 9- to 17-digit bank account number, without separators or whitespace. Starts with the + * 3-digit branch code. + * + * @param accountNumber The 9- to 17-digit bank account number, without separators or whitespace. + * Starts with the 3-digit branch code. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * The 3-digit clearing code, without separators or whitespace. + * + * @param clearingCode The 3-digit clearing code, without separators or whitespace. + * @return the current {@code HKLocalAccountIdentification} instance, allowing for method chaining + */ + public HKLocalAccountIdentification clearingCode(String clearingCode) { + this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set + return this; + } + + /** + * The 3-digit clearing code, without separators or whitespace. + * + * @return clearingCode The 3-digit clearing code, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_CLEARING_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClearingCode() { + return clearingCode; + } + + /** + * The 3-digit clearing code, without separators or whitespace. + * + * @param clearingCode The 3-digit clearing code, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_CLEARING_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClearingCode(String clearingCode) { + this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set + } + + /** + * **hkLocal** + * + * @param type **hkLocal** + * @return the current {@code HKLocalAccountIdentification} instance, allowing for method chaining + */ + public HKLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **hkLocal** + * + * @return type **hkLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **hkLocal** + * + * @param type **hkLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this HKLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HKLocalAccountIdentification hkLocalAccountIdentification = (HKLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, hkLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, hkLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.clearingCode, hkLocalAccountIdentification.clearingCode) + && Objects.equals(this.isSetClearingCode, hkLocalAccountIdentification.isSetClearingCode) + && Objects.equals(this.type, hkLocalAccountIdentification.type) + && Objects.equals(this.isSetType, hkLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + clearingCode, + isSetClearingCode, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HKLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" clearingCode: ").append(toIndentedString(clearingCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("HKLocalAccountIdentification", HKLocalAccountIdentification.class); + JSON.registerDiscriminator(HKLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of HKLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of HKLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * HKLocalAccountIdentification + */ + public static HKLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, HKLocalAccountIdentification.class); + } + + /** + * Convert an instance of HKLocalAccountIdentification 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/capital/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/HULocalAccountIdentification.java new file mode 100644 index 000000000..79d21d14c --- /dev/null +++ b/src/main/java/com/adyen/model/capital/HULocalAccountIdentification.java @@ -0,0 +1,249 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** HULocalAccountIdentification */ +@JsonPropertyOrder({ + HULocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + HULocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class HULocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public HULocalAccountIdentification() {} + + /** + * The 24-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 24-digit bank account number, without separators or whitespace. + * @return the current {@code HULocalAccountIdentification} instance, allowing for method chaining + */ + public HULocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 24-digit bank account number, without separators or whitespace. + * + * @return accountNumber The 24-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 24-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 24-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * **huLocal** + * + * @param type **huLocal** + * @return the current {@code HULocalAccountIdentification} instance, allowing for method chaining + */ + public HULocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **huLocal** + * + * @return type **huLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **huLocal** + * + * @param type **huLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public HULocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this HULocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HULocalAccountIdentification huLocalAccountIdentification = (HULocalAccountIdentification) o; + return Objects.equals(this.accountNumber, huLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, huLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, huLocalAccountIdentification.type) + && Objects.equals(this.isSetType, huLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HULocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("HULocalAccountIdentification", HULocalAccountIdentification.class); + JSON.registerDiscriminator(HULocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of HULocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of HULocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * HULocalAccountIdentification + */ + public static HULocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, HULocalAccountIdentification.class); + } + + /** + * Convert an instance of HULocalAccountIdentification 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/capital/IbanAccountIdentification.java b/src/main/java/com/adyen/model/capital/IbanAccountIdentification.java new file mode 100644 index 000000000..811743216 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/IbanAccountIdentification.java @@ -0,0 +1,255 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** IbanAccountIdentification */ +@JsonPropertyOrder({ + IbanAccountIdentification.JSON_PROPERTY_IBAN, + IbanAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class IbanAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_IBAN = "iban"; + private String iban; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public 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; + isSetIban = true; // mark as set + 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; + isSetIban = true; // mark as set + } + + /** + * **iban** + * + * @param type **iban** + * @return the current {@code IbanAccountIdentification} instance, allowing for method chaining + */ + public IbanAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **iban** + * + * @return type **iban** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **iban** + * + * @param type **iban** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IbanAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this IbanAccountIdentification object is equal to o. */ + @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.isSetIban, ibanAccountIdentification.isSetIban) + && Objects.equals(this.type, ibanAccountIdentification.type) + && Objects.equals(this.isSetType, ibanAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(iban, isSetIban, type, isSetType, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IbanAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\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 "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("IbanAccountIdentification", IbanAccountIdentification.class); + JSON.registerDiscriminator(IbanAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of IbanAccountIdentification given an JSON string + * + * @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/capital/InvalidField.java b/src/main/java/com/adyen/model/capital/InvalidField.java new file mode 100644 index 000000000..25f8a29de --- /dev/null +++ b/src/main/java/com/adyen/model/capital/InvalidField.java @@ -0,0 +1,273 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** InvalidField */ +@JsonPropertyOrder({ + InvalidField.JSON_PROPERTY_NAME, + InvalidField.JSON_PROPERTY_VALUE, + InvalidField.JSON_PROPERTY_MESSAGE +}) +public class InvalidField { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InvalidField() {} + + /** + * The field that has an invalid value. + * + * @param name The field that has an invalid value. + * @return the current {@code InvalidField} instance, allowing for method chaining + */ + public InvalidField name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The field that has an invalid value. + * + * @return name The field that has an invalid value. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The field that has an invalid value. + * + * @param name The field that has an invalid value. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set + } + + /** + * The invalid value. + * + * @param value The invalid value. + * @return the current {@code InvalidField} instance, allowing for method chaining + */ + public InvalidField value(String value) { + this.value = value; + isSetValue = true; // mark as set + return this; + } + + /** + * The invalid value. + * + * @return value The invalid value. + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + /** + * The invalid value. + * + * @param value The invalid value. + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + isSetValue = true; // mark as set + } + + /** + * Description of the validation error. + * + * @param message Description of the validation error. + * @return the current {@code InvalidField} instance, allowing for method chaining + */ + public InvalidField message(String message) { + this.message = message; + isSetMessage = true; // mark as set + return this; + } + + /** + * Description of the validation error. + * + * @return message Description of the validation error. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + /** + * Description of the validation error. + * + * @param message Description of the validation error. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this InvalidField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvalidField invalidField = (InvalidField) o; + return Objects.equals(this.name, invalidField.name) + && Objects.equals(this.isSetName, invalidField.isSetName) + && Objects.equals(this.value, invalidField.value) + && Objects.equals(this.isSetValue, invalidField.isSetValue) + && Objects.equals(this.message, invalidField.message) + && Objects.equals(this.isSetMessage, invalidField.isSetMessage); + } + + @Override + public int hashCode() { + return Objects.hash(name, isSetName, value, isSetValue, message, isSetMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvalidField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of InvalidField given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvalidField + * @throws JsonProcessingException if the JSON string is invalid with respect to InvalidField + */ + public static InvalidField fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InvalidField.class); + } + + /** + * Convert an instance of InvalidField 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/capital/JSON.java b/src/main/java/com/adyen/model/capital/JSON.java new file mode 100644 index 000000000..3744084be --- /dev/null +++ b/src/main/java/com/adyen/model/capital/JSON.java @@ -0,0 +1,251 @@ +package com.adyen.model.capital; + +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/capital/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/NOLocalAccountIdentification.java new file mode 100644 index 000000000..8ccb59293 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/NOLocalAccountIdentification.java @@ -0,0 +1,249 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** NOLocalAccountIdentification */ +@JsonPropertyOrder({ + NOLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + NOLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class NOLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public NOLocalAccountIdentification() {} + + /** + * The 11-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 11-digit bank account number, without separators or whitespace. + * @return the current {@code NOLocalAccountIdentification} instance, allowing for method chaining + */ + public NOLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 11-digit bank account number, without separators or whitespace. + * + * @return accountNumber The 11-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 11-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 11-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * **noLocal** + * + * @param type **noLocal** + * @return the current {@code NOLocalAccountIdentification} instance, allowing for method chaining + */ + public NOLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **noLocal** + * + * @return type **noLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **noLocal** + * + * @param type **noLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NOLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this NOLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NOLocalAccountIdentification noLocalAccountIdentification = (NOLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, noLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, noLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, noLocalAccountIdentification.type) + && Objects.equals(this.isSetType, noLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NOLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("NOLocalAccountIdentification", NOLocalAccountIdentification.class); + JSON.registerDiscriminator(NOLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of NOLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of NOLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * NOLocalAccountIdentification + */ + public static NOLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, NOLocalAccountIdentification.class); + } + + /** + * Convert an instance of NOLocalAccountIdentification 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/capital/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/NZLocalAccountIdentification.java new file mode 100644 index 000000000..d2ea8e344 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/NZLocalAccountIdentification.java @@ -0,0 +1,261 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** NZLocalAccountIdentification */ +@JsonPropertyOrder({ + NZLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + NZLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class NZLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public NZLocalAccountIdentification() {} + + /** + * The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits + * are the branch number, the next 7 digits are the account number, and the final 2-3 digits are + * the suffix. + * + * @param accountNumber The 15-16 digit bank account number. The first 2 digits are the bank + * number, the next 4 digits are the branch number, the next 7 digits are the account number, + * and the final 2-3 digits are the suffix. + * @return the current {@code NZLocalAccountIdentification} instance, allowing for method chaining + */ + public NZLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits + * are the branch number, the next 7 digits are the account number, and the final 2-3 digits are + * the suffix. + * + * @return accountNumber The 15-16 digit bank account number. The first 2 digits are the bank + * number, the next 4 digits are the branch number, the next 7 digits are the account number, + * and the final 2-3 digits are the suffix. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits + * are the branch number, the next 7 digits are the account number, and the final 2-3 digits are + * the suffix. + * + * @param accountNumber The 15-16 digit bank account number. The first 2 digits are the bank + * number, the next 4 digits are the branch number, the next 7 digits are the account number, + * and the final 2-3 digits are the suffix. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * **nzLocal** + * + * @param type **nzLocal** + * @return the current {@code NZLocalAccountIdentification} instance, allowing for method chaining + */ + public NZLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **nzLocal** + * + * @return type **nzLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **nzLocal** + * + * @param type **nzLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NZLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this NZLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NZLocalAccountIdentification nzLocalAccountIdentification = (NZLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, nzLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, nzLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, nzLocalAccountIdentification.type) + && Objects.equals(this.isSetType, nzLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NZLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("NZLocalAccountIdentification", NZLocalAccountIdentification.class); + JSON.registerDiscriminator(NZLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of NZLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of NZLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * NZLocalAccountIdentification + */ + public static NZLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, NZLocalAccountIdentification.class); + } + + /** + * Convert an instance of NZLocalAccountIdentification 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/capital/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/capital/NumberAndBicAccountIdentification.java new file mode 100644 index 000000000..980770d70 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/NumberAndBicAccountIdentification.java @@ -0,0 +1,376 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** NumberAndBicAccountIdentification */ +@JsonPropertyOrder({ + NumberAndBicAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + NumberAndBicAccountIdentification.JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, + NumberAndBicAccountIdentification.JSON_PROPERTY_BIC, + NumberAndBicAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class NumberAndBicAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = + "additionalBankIdentification"; + private AdditionalBankIdentification additionalBankIdentification; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + + public static final String JSON_PROPERTY_BIC = "bic"; + private String bic; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public NumberAndBicAccountIdentification() {} + + /** + * The bank account number, without separators or whitespace. The length and format depends on the + * bank or country. + * + * @param accountNumber The bank account number, without separators or whitespace. The length and + * format depends on the bank or country. + * @return the current {@code NumberAndBicAccountIdentification} instance, allowing for method + * chaining + */ + public NumberAndBicAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The bank account number, without separators or whitespace. The length and format depends on the + * bank or country. + * + * @return accountNumber The bank account number, without separators or whitespace. The length and + * format depends on the bank or country. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The bank account number, without separators or whitespace. The length and format depends on the + * bank or country. + * + * @param accountNumber The bank account number, without separators or whitespace. The length and + * format depends on the bank or country. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * additionalBankIdentification + * + * @param additionalBankIdentification + * @return the current {@code NumberAndBicAccountIdentification} instance, allowing for method + * chaining + */ + public NumberAndBicAccountIdentification additionalBankIdentification( + AdditionalBankIdentification additionalBankIdentification) { + this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set + return this; + } + + /** + * Get additionalBankIdentification + * + * @return additionalBankIdentification + */ + @JsonProperty(JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AdditionalBankIdentification getAdditionalBankIdentification() { + return additionalBankIdentification; + } + + /** + * additionalBankIdentification + * + * @param additionalBankIdentification + */ + @JsonProperty(JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalBankIdentification( + AdditionalBankIdentification additionalBankIdentification) { + this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @param bic The bank's 8- or 11-character BIC or SWIFT code. + * @return the current {@code NumberAndBicAccountIdentification} instance, allowing for method + * chaining + */ + public NumberAndBicAccountIdentification bic(String bic) { + this.bic = bic; + isSetBic = true; // mark as set + return this; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @return bic The bank's 8- or 11-character BIC or SWIFT code. + */ + @JsonProperty(JSON_PROPERTY_BIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBic() { + return bic; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @param bic The bank's 8- or 11-character BIC or SWIFT code. + */ + @JsonProperty(JSON_PROPERTY_BIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBic(String bic) { + this.bic = bic; + isSetBic = true; // mark as set + } + + /** + * **numberAndBic** + * + * @param type **numberAndBic** + * @return the current {@code NumberAndBicAccountIdentification} instance, allowing for method + * chaining + */ + public NumberAndBicAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **numberAndBic** + * + * @return type **numberAndBic** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **numberAndBic** + * + * @param type **numberAndBic** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NumberAndBicAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this NumberAndBicAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberAndBicAccountIdentification numberAndBicAccountIdentification = + (NumberAndBicAccountIdentification) o; + return Objects.equals(this.accountNumber, numberAndBicAccountIdentification.accountNumber) + && Objects.equals( + this.isSetAccountNumber, numberAndBicAccountIdentification.isSetAccountNumber) + && Objects.equals( + this.additionalBankIdentification, + numberAndBicAccountIdentification.additionalBankIdentification) + && Objects.equals( + this.isSetAdditionalBankIdentification, + numberAndBicAccountIdentification.isSetAdditionalBankIdentification) + && Objects.equals(this.bic, numberAndBicAccountIdentification.bic) + && Objects.equals(this.isSetBic, numberAndBicAccountIdentification.isSetBic) + && Objects.equals(this.type, numberAndBicAccountIdentification.type) + && Objects.equals(this.isSetType, numberAndBicAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + additionalBankIdentification, + isSetAdditionalBankIdentification, + bic, + isSetBic, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberAndBicAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" additionalBankIdentification: ") + .append(toIndentedString(additionalBankIdentification)) + .append("\n"); + sb.append(" bic: ").append(toIndentedString(bic)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("NumberAndBicAccountIdentification", NumberAndBicAccountIdentification.class); + JSON.registerDiscriminator(NumberAndBicAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of NumberAndBicAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberAndBicAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * NumberAndBicAccountIdentification + */ + public static NumberAndBicAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, NumberAndBicAccountIdentification.class); + } + + /** + * Convert an instance of NumberAndBicAccountIdentification 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/capital/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/PLLocalAccountIdentification.java new file mode 100644 index 000000000..b38ce848d --- /dev/null +++ b/src/main/java/com/adyen/model/capital/PLLocalAccountIdentification.java @@ -0,0 +1,261 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PLLocalAccountIdentification */ +@JsonPropertyOrder({ + PLLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + PLLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class PLLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PLLocalAccountIdentification() {} + + /** + * The 26-digit bank account number ([Numer + * rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or + * whitespace. + * + * @param accountNumber The 26-digit bank account number ([Numer + * rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or + * whitespace. + * @return the current {@code PLLocalAccountIdentification} instance, allowing for method chaining + */ + public PLLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 26-digit bank account number ([Numer + * rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or + * whitespace. + * + * @return accountNumber The 26-digit bank account number ([Numer + * rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or + * whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 26-digit bank account number ([Numer + * rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or + * whitespace. + * + * @param accountNumber The 26-digit bank account number ([Numer + * rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or + * whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * **plLocal** + * + * @param type **plLocal** + * @return the current {@code PLLocalAccountIdentification} instance, allowing for method chaining + */ + public PLLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **plLocal** + * + * @return type **plLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **plLocal** + * + * @param type **plLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PLLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PLLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PLLocalAccountIdentification plLocalAccountIdentification = (PLLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, plLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, plLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, plLocalAccountIdentification.type) + && Objects.equals(this.isSetType, plLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PLLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("PLLocalAccountIdentification", PLLocalAccountIdentification.class); + JSON.registerDiscriminator(PLLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PLLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of PLLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PLLocalAccountIdentification + */ + public static PLLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PLLocalAccountIdentification.class); + } + + /** + * Convert an instance of PLLocalAccountIdentification 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/capital/Repayment.java b/src/main/java/com/adyen/model/capital/Repayment.java new file mode 100644 index 000000000..8871e65e3 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Repayment.java @@ -0,0 +1,285 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Repayment */ +@JsonPropertyOrder({ + Repayment.JSON_PROPERTY_BASIS_POINTS, + Repayment.JSON_PROPERTY_TERM, + Repayment.JSON_PROPERTY_THRESHOLD +}) +public class Repayment { + public static final String JSON_PROPERTY_BASIS_POINTS = "basisPoints"; + private Integer basisPoints; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasisPoints = false; + + public static final String JSON_PROPERTY_TERM = "term"; + private RepaymentTerm term; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTerm = false; + + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; + private ThresholdRepayment threshold; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreshold = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Repayment() {} + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @param basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * @return the current {@code Repayment} instance, allowing for method chaining + */ + public Repayment basisPoints(Integer basisPoints) { + this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set + return this; + } + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @return basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + */ + @JsonProperty(JSON_PROPERTY_BASIS_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getBasisPoints() { + return basisPoints; + } + + /** + * The percentage of your user's incoming net volume that is deducted for repaying the grant. + * The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + * + * @param basisPoints The percentage of your user's incoming net volume that is deducted for + * repaying the grant. The percentage expressed in [basis + * points](https://www.investopedia.com/terms/b/basispoint.asp). + */ + @JsonProperty(JSON_PROPERTY_BASIS_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBasisPoints(Integer basisPoints) { + this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set + } + + /** + * term + * + * @param term + * @return the current {@code Repayment} instance, allowing for method chaining + */ + public Repayment term(RepaymentTerm term) { + this.term = term; + isSetTerm = true; // mark as set + return this; + } + + /** + * Get term + * + * @return term + */ + @JsonProperty(JSON_PROPERTY_TERM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RepaymentTerm getTerm() { + return term; + } + + /** + * term + * + * @param term + */ + @JsonProperty(JSON_PROPERTY_TERM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTerm(RepaymentTerm term) { + this.term = term; + isSetTerm = true; // mark as set + } + + /** + * threshold + * + * @param threshold + * @return the current {@code Repayment} instance, allowing for method chaining + */ + public Repayment threshold(ThresholdRepayment threshold) { + this.threshold = threshold; + isSetThreshold = true; // mark as set + return this; + } + + /** + * Get threshold + * + * @return threshold + */ + @JsonProperty(JSON_PROPERTY_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ThresholdRepayment getThreshold() { + return threshold; + } + + /** + * threshold + * + * @param threshold + */ + @JsonProperty(JSON_PROPERTY_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreshold(ThresholdRepayment threshold) { + this.threshold = threshold; + isSetThreshold = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Repayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Repayment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Repayment repayment = (Repayment) o; + return Objects.equals(this.basisPoints, repayment.basisPoints) + && Objects.equals(this.isSetBasisPoints, repayment.isSetBasisPoints) + && Objects.equals(this.term, repayment.term) + && Objects.equals(this.isSetTerm, repayment.isSetTerm) + && Objects.equals(this.threshold, repayment.threshold) + && Objects.equals(this.isSetThreshold, repayment.isSetThreshold); + } + + @Override + public int hashCode() { + return Objects.hash(basisPoints, isSetBasisPoints, term, isSetTerm, threshold, isSetThreshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Repayment {\n"); + sb.append(" basisPoints: ").append(toIndentedString(basisPoints)).append("\n"); + sb.append(" term: ").append(toIndentedString(term)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBasisPoints) { + addIfNull(nulls, JSON_PROPERTY_BASIS_POINTS, this.basisPoints); + } + if (isSetTerm) { + addIfNull(nulls, JSON_PROPERTY_TERM, this.term); + } + if (isSetThreshold) { + addIfNull(nulls, JSON_PROPERTY_THRESHOLD, this.threshold); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Repayment given an JSON string + * + * @param jsonString JSON string + * @return An instance of Repayment + * @throws JsonProcessingException if the JSON string is invalid with respect to Repayment + */ + public static Repayment fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Repayment.class); + } + + /** + * Convert an instance of Repayment 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/capital/RepaymentTerm.java b/src/main/java/com/adyen/model/capital/RepaymentTerm.java new file mode 100644 index 000000000..696ffa3a4 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/RepaymentTerm.java @@ -0,0 +1,231 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** RepaymentTerm */ +@JsonPropertyOrder({ + RepaymentTerm.JSON_PROPERTY_ESTIMATED_DAYS, + RepaymentTerm.JSON_PROPERTY_MAXIMUM_DAYS +}) +public class RepaymentTerm { + public static final String JSON_PROPERTY_ESTIMATED_DAYS = "estimatedDays"; + private Integer estimatedDays; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedDays = false; + + public static final String JSON_PROPERTY_MAXIMUM_DAYS = "maximumDays"; + private Integer maximumDays; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaximumDays = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public RepaymentTerm() {} + + /** + * The estimated duration of the repayment term, in days. + * + * @param estimatedDays The estimated duration of the repayment term, in days. + * @return the current {@code RepaymentTerm} instance, allowing for method chaining + */ + public RepaymentTerm estimatedDays(Integer estimatedDays) { + this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set + return this; + } + + /** + * The estimated duration of the repayment term, in days. + * + * @return estimatedDays The estimated duration of the repayment term, in days. + */ + @JsonProperty(JSON_PROPERTY_ESTIMATED_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getEstimatedDays() { + return estimatedDays; + } + + /** + * The estimated duration of the repayment term, in days. + * + * @param estimatedDays The estimated duration of the repayment term, in days. + */ + @JsonProperty(JSON_PROPERTY_ESTIMATED_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEstimatedDays(Integer estimatedDays) { + this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set + } + + /** + * The maximum duration of the repayment term, in days. Only applies when `contractType` + * is **loan**. + * + * @param maximumDays The maximum duration of the repayment term, in days. Only applies when + * `contractType` is **loan**. + * @return the current {@code RepaymentTerm} instance, allowing for method chaining + */ + public RepaymentTerm maximumDays(Integer maximumDays) { + this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set + return this; + } + + /** + * The maximum duration of the repayment term, in days. Only applies when `contractType` + * is **loan**. + * + * @return maximumDays The maximum duration of the repayment term, in days. Only applies when + * `contractType` is **loan**. + */ + @JsonProperty(JSON_PROPERTY_MAXIMUM_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMaximumDays() { + return maximumDays; + } + + /** + * The maximum duration of the repayment term, in days. Only applies when `contractType` + * is **loan**. + * + * @param maximumDays The maximum duration of the repayment term, in days. Only applies when + * `contractType` is **loan**. + */ + @JsonProperty(JSON_PROPERTY_MAXIMUM_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaximumDays(Integer maximumDays) { + this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RepaymentTerm includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this RepaymentTerm object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepaymentTerm repaymentTerm = (RepaymentTerm) o; + return Objects.equals(this.estimatedDays, repaymentTerm.estimatedDays) + && Objects.equals(this.isSetEstimatedDays, repaymentTerm.isSetEstimatedDays) + && Objects.equals(this.maximumDays, repaymentTerm.maximumDays) + && Objects.equals(this.isSetMaximumDays, repaymentTerm.isSetMaximumDays); + } + + @Override + public int hashCode() { + return Objects.hash(estimatedDays, isSetEstimatedDays, maximumDays, isSetMaximumDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepaymentTerm {\n"); + sb.append(" estimatedDays: ").append(toIndentedString(estimatedDays)).append("\n"); + sb.append(" maximumDays: ").append(toIndentedString(maximumDays)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEstimatedDays) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_DAYS, this.estimatedDays); + } + if (isSetMaximumDays) { + addIfNull(nulls, JSON_PROPERTY_MAXIMUM_DAYS, this.maximumDays); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of RepaymentTerm given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepaymentTerm + * @throws JsonProcessingException if the JSON string is invalid with respect to RepaymentTerm + */ + public static RepaymentTerm fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, RepaymentTerm.class); + } + + /** + * Convert an instance of RepaymentTerm 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/capital/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/SELocalAccountIdentification.java new file mode 100644 index 000000000..afbc19f25 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/SELocalAccountIdentification.java @@ -0,0 +1,329 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** SELocalAccountIdentification */ +@JsonPropertyOrder({ + SELocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + SELocalAccountIdentification.JSON_PROPERTY_CLEARING_NUMBER, + SELocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class SELocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; + private String clearingNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SELocalAccountIdentification() {} + + /** + * The 7- to 10-digit bank account number + * ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, + * separators, or whitespace. + * + * @param accountNumber The 7- to 10-digit bank account number + * ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, + * separators, or whitespace. + * @return the current {@code SELocalAccountIdentification} instance, allowing for method chaining + */ + public SELocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 7- to 10-digit bank account number + * ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, + * separators, or whitespace. + * + * @return accountNumber The 7- to 10-digit bank account number + * ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, + * separators, or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 7- to 10-digit bank account number + * ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, + * separators, or whitespace. + * + * @param accountNumber The 7- to 10-digit bank account number + * ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, + * separators, or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * The 4- to 5-digit clearing number + * ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or + * whitespace. + * + * @param clearingNumber The 4- to 5-digit clearing number + * ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or + * whitespace. + * @return the current {@code SELocalAccountIdentification} instance, allowing for method chaining + */ + public SELocalAccountIdentification clearingNumber(String clearingNumber) { + this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set + return this; + } + + /** + * The 4- to 5-digit clearing number + * ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or + * whitespace. + * + * @return clearingNumber The 4- to 5-digit clearing number + * ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or + * whitespace. + */ + @JsonProperty(JSON_PROPERTY_CLEARING_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClearingNumber() { + return clearingNumber; + } + + /** + * The 4- to 5-digit clearing number + * ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or + * whitespace. + * + * @param clearingNumber The 4- to 5-digit clearing number + * ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or + * whitespace. + */ + @JsonProperty(JSON_PROPERTY_CLEARING_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClearingNumber(String clearingNumber) { + this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set + } + + /** + * **seLocal** + * + * @param type **seLocal** + * @return the current {@code SELocalAccountIdentification} instance, allowing for method chaining + */ + public SELocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **seLocal** + * + * @return type **seLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **seLocal** + * + * @param type **seLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SELocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SELocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SELocalAccountIdentification seLocalAccountIdentification = (SELocalAccountIdentification) o; + return Objects.equals(this.accountNumber, seLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, seLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.clearingNumber, seLocalAccountIdentification.clearingNumber) + && Objects.equals( + this.isSetClearingNumber, seLocalAccountIdentification.isSetClearingNumber) + && Objects.equals(this.type, seLocalAccountIdentification.type) + && Objects.equals(this.isSetType, seLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + clearingNumber, + isSetClearingNumber, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SELocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" clearingNumber: ").append(toIndentedString(clearingNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SELocalAccountIdentification", SELocalAccountIdentification.class); + JSON.registerDiscriminator(SELocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SELocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of SELocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * SELocalAccountIdentification + */ + public static SELocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SELocalAccountIdentification.class); + } + + /** + * Convert an instance of SELocalAccountIdentification 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/capital/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/SGLocalAccountIdentification.java new file mode 100644 index 000000000..e1a399115 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/SGLocalAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** SGLocalAccountIdentification */ +@JsonPropertyOrder({ + SGLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + SGLocalAccountIdentification.JSON_PROPERTY_BIC, + SGLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class SGLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_BIC = "bic"; + private String bic; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SGLocalAccountIdentification() {} + + /** + * The 4- to 19-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 4- to 19-digit bank account number, without separators or whitespace. + * @return the current {@code SGLocalAccountIdentification} instance, allowing for method chaining + */ + public SGLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 4- to 19-digit bank account number, without separators or whitespace. + * + * @return accountNumber The 4- to 19-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 4- to 19-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 4- to 19-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @param bic The bank's 8- or 11-character BIC or SWIFT code. + * @return the current {@code SGLocalAccountIdentification} instance, allowing for method chaining + */ + public SGLocalAccountIdentification bic(String bic) { + this.bic = bic; + isSetBic = true; // mark as set + return this; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @return bic The bank's 8- or 11-character BIC or SWIFT code. + */ + @JsonProperty(JSON_PROPERTY_BIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBic() { + return bic; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * + * @param bic The bank's 8- or 11-character BIC or SWIFT code. + */ + @JsonProperty(JSON_PROPERTY_BIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBic(String bic) { + this.bic = bic; + isSetBic = true; // mark as set + } + + /** + * **sgLocal** + * + * @param type **sgLocal** + * @return the current {@code SGLocalAccountIdentification} instance, allowing for method chaining + */ + public SGLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **sgLocal** + * + * @return type **sgLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **sgLocal** + * + * @param type **sgLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SGLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SGLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SGLocalAccountIdentification sgLocalAccountIdentification = (SGLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, sgLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, sgLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.bic, sgLocalAccountIdentification.bic) + && Objects.equals(this.isSetBic, sgLocalAccountIdentification.isSetBic) + && Objects.equals(this.type, sgLocalAccountIdentification.type) + && Objects.equals(this.isSetType, sgLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, isSetAccountNumber, bic, isSetBic, type, isSetType, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SGLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bic: ").append(toIndentedString(bic)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SGLocalAccountIdentification", SGLocalAccountIdentification.class); + JSON.registerDiscriminator(SGLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SGLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of SGLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * SGLocalAccountIdentification + */ + public static SGLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SGLocalAccountIdentification.class); + } + + /** + * Convert an instance of SGLocalAccountIdentification 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/capital/Status.java b/src/main/java/com/adyen/model/capital/Status.java new file mode 100644 index 000000000..e7f5a3dda --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Status.java @@ -0,0 +1,315 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; + +/** Status */ +@JsonPropertyOrder({Status.JSON_PROPERTY_ACTIONS, Status.JSON_PROPERTY_CODE}) +public class Status { + public static final String JSON_PROPERTY_ACTIONS = "actions"; + private List actions; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActions = false; + + /** + * The code for the status of the grant. Possible values: - **Pending** - **Active** - **Repaid** + * - **WrittenOff** - **Failed** - **Revoked** - **Requested** - **Underwriting** - **Reviewing** + * - **Assessed** - **Approved** - **Rejected** - **Cancelled** + */ + public enum CodeEnum { + PENDING(String.valueOf("Pending")), + + ACTIVE(String.valueOf("Active")), + + REPAID(String.valueOf("Repaid")), + + WRITTENOFF(String.valueOf("WrittenOff")), + + FAILED(String.valueOf("Failed")), + + REVOKED(String.valueOf("Revoked")), + + REQUESTED(String.valueOf("Requested")), + + UNDERWRITING(String.valueOf("Underwriting")), + + REVIEWING(String.valueOf("Reviewing")), + + ASSESSED(String.valueOf("Assessed")), + + APPROVED(String.valueOf("Approved")), + + REJECTED(String.valueOf("Rejected")), + + CANCELLED(String.valueOf("Cancelled")); + + private static final Logger LOG = Logger.getLogger(CodeEnum.class.getName()); + + private String value; + + CodeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CodeEnum fromValue(String value) { + for (CodeEnum b : CodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "CodeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(CodeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_CODE = "code"; + private CodeEnum code; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Status() {} + + /** + * A list of actions that need to be completed to proceed with the grant. + * + * @param actions A list of actions that need to be completed to proceed with the grant. + * @return the current {@code Status} instance, allowing for method chaining + */ + public Status actions(List actions) { + this.actions = actions; + isSetActions = true; // mark as set + return this; + } + + public Status addActionsItem(Action actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } + this.actions.add(actionsItem); + return this; + } + + /** + * A list of actions that need to be completed to proceed with the grant. + * + * @return actions A list of actions that need to be completed to proceed with the grant. + */ + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getActions() { + return actions; + } + + /** + * A list of actions that need to be completed to proceed with the grant. + * + * @param actions A list of actions that need to be completed to proceed with the grant. + */ + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActions(List actions) { + this.actions = actions; + isSetActions = true; // mark as set + } + + /** + * The code for the status of the grant. Possible values: - **Pending** - **Active** - **Repaid** + * - **WrittenOff** - **Failed** - **Revoked** - **Requested** - **Underwriting** - **Reviewing** + * - **Assessed** - **Approved** - **Rejected** - **Cancelled** + * + * @param code The code for the status of the grant. Possible values: - **Pending** - **Active** - + * **Repaid** - **WrittenOff** - **Failed** - **Revoked** - **Requested** - **Underwriting** - + * **Reviewing** - **Assessed** - **Approved** - **Rejected** - **Cancelled** + * @return the current {@code Status} instance, allowing for method chaining + */ + public Status code(CodeEnum code) { + this.code = code; + isSetCode = true; // mark as set + return this; + } + + /** + * The code for the status of the grant. Possible values: - **Pending** - **Active** - **Repaid** + * - **WrittenOff** - **Failed** - **Revoked** - **Requested** - **Underwriting** - **Reviewing** + * - **Assessed** - **Approved** - **Rejected** - **Cancelled** + * + * @return code The code for the status of the grant. Possible values: - **Pending** - **Active** + * - **Repaid** - **WrittenOff** - **Failed** - **Revoked** - **Requested** - **Underwriting** + * - **Reviewing** - **Assessed** - **Approved** - **Rejected** - **Cancelled** + */ + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CodeEnum getCode() { + return code; + } + + /** + * The code for the status of the grant. Possible values: - **Pending** - **Active** - **Repaid** + * - **WrittenOff** - **Failed** - **Revoked** - **Requested** - **Underwriting** - **Reviewing** + * - **Assessed** - **Approved** - **Rejected** - **Cancelled** + * + * @param code The code for the status of the grant. Possible values: - **Pending** - **Active** - + * **Repaid** - **WrittenOff** - **Failed** - **Revoked** - **Requested** - **Underwriting** - + * **Reviewing** - **Assessed** - **Approved** - **Rejected** - **Cancelled** + */ + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(CodeEnum code) { + this.code = code; + isSetCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Status includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Status object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Status status = (Status) o; + return Objects.equals(this.actions, status.actions) + && Objects.equals(this.isSetActions, status.isSetActions) + && Objects.equals(this.code, status.code) + && Objects.equals(this.isSetCode, status.isSetCode); + } + + @Override + public int hashCode() { + return Objects.hash(actions, isSetActions, code, isSetCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Status {\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetActions) { + addIfNull(nulls, JSON_PROPERTY_ACTIONS, this.actions); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Status given an JSON string + * + * @param jsonString JSON string + * @return An instance of Status + * @throws JsonProcessingException if the JSON string is invalid with respect to Status + */ + public static Status fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Status.class); + } + + /** + * Convert an instance of Status 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/capital/ThresholdRepayment.java b/src/main/java/com/adyen/model/capital/ThresholdRepayment.java new file mode 100644 index 000000000..b8f33380a --- /dev/null +++ b/src/main/java/com/adyen/model/capital/ThresholdRepayment.java @@ -0,0 +1,176 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** ThresholdRepayment */ +@JsonPropertyOrder({ThresholdRepayment.JSON_PROPERTY_AMOUNT}) +public class ThresholdRepayment { + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ThresholdRepayment() {} + + /** + * amount + * + * @param amount + * @return the current {@code ThresholdRepayment} instance, allowing for method chaining + */ + public ThresholdRepayment amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThresholdRepayment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ThresholdRepayment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ThresholdRepayment thresholdRepayment = (ThresholdRepayment) o; + return Objects.equals(this.amount, thresholdRepayment.amount) + && Objects.equals(this.isSetAmount, thresholdRepayment.isSetAmount); + } + + @Override + public int hashCode() { + return Objects.hash(amount, isSetAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ThresholdRepayment {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ThresholdRepayment given an JSON string + * + * @param jsonString JSON string + * @return An instance of ThresholdRepayment + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ThresholdRepayment + */ + public static ThresholdRepayment fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ThresholdRepayment.class); + } + + /** + * Convert an instance of ThresholdRepayment 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/capital/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/UKLocalAccountIdentification.java new file mode 100644 index 000000000..97be7bd49 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/UKLocalAccountIdentification.java @@ -0,0 +1,310 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** UKLocalAccountIdentification */ +@JsonPropertyOrder({ + UKLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + UKLocalAccountIdentification.JSON_PROPERTY_SORT_CODE, + UKLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class UKLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; + private String sortCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public UKLocalAccountIdentification() {} + + /** + * The 8-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 8-digit bank account number, without separators or whitespace. + * @return the current {@code UKLocalAccountIdentification} instance, allowing for method chaining + */ + public UKLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + return this; + } + + /** + * The 8-digit bank account number, without separators or whitespace. + * + * @return accountNumber The 8-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountNumber() { + return accountNumber; + } + + /** + * The 8-digit bank account number, without separators or whitespace. + * + * @param accountNumber The 8-digit bank account number, without separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + } + + /** + * The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or + * whitespace. + * + * @param sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without + * separators or whitespace. + * @return the current {@code UKLocalAccountIdentification} instance, allowing for method chaining + */ + public UKLocalAccountIdentification sortCode(String sortCode) { + this.sortCode = sortCode; + isSetSortCode = true; // mark as set + return this; + } + + /** + * The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or + * whitespace. + * + * @return sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without + * separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_SORT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSortCode() { + return sortCode; + } + + /** + * The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or + * whitespace. + * + * @param sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without + * separators or whitespace. + */ + @JsonProperty(JSON_PROPERTY_SORT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSortCode(String sortCode) { + this.sortCode = sortCode; + isSetSortCode = true; // mark as set + } + + /** + * **ukLocal** + * + * @param type **ukLocal** + * @return the current {@code UKLocalAccountIdentification} instance, allowing for method chaining + */ + public UKLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **ukLocal** + * + * @return type **ukLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **ukLocal** + * + * @param type **ukLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UKLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this UKLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UKLocalAccountIdentification ukLocalAccountIdentification = (UKLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, ukLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, ukLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.sortCode, ukLocalAccountIdentification.sortCode) + && Objects.equals(this.isSetSortCode, ukLocalAccountIdentification.isSetSortCode) + && Objects.equals(this.type, ukLocalAccountIdentification.type) + && Objects.equals(this.isSetType, ukLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + sortCode, + isSetSortCode, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UKLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" sortCode: ").append(toIndentedString(sortCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("UKLocalAccountIdentification", UKLocalAccountIdentification.class); + JSON.registerDiscriminator(UKLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of UKLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of UKLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * UKLocalAccountIdentification + */ + public static UKLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, UKLocalAccountIdentification.class); + } + + /** + * Convert an instance of UKLocalAccountIdentification 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/capital/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/capital/USLocalAccountIdentification.java new file mode 100644 index 000000000..342620704 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/USLocalAccountIdentification.java @@ -0,0 +1,363 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** USLocalAccountIdentification */ +@JsonPropertyOrder({ + USLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + USLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_TYPE, + USLocalAccountIdentification.JSON_PROPERTY_ROUTING_NUMBER, + USLocalAccountIdentification.JSON_PROPERTY_TYPE +}) +@JsonIgnoreProperties( + value = + "type", // ignore manually set type, it will be automatically generated by Jackson during + // serialization + allowSetters = true // allows the type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + visible = true) +public class USLocalAccountIdentification extends BankAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + + public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; + private USLocalBankAccountType accountType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + + public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber"; + private String routingNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public USLocalAccountIdentification() {} + + /** + * The bank account number, without separators or whitespace. + * + * @param accountNumber The bank account number, without separators or whitespace. + * @return the current {@code USLocalAccountIdentification} instance, allowing for method chaining + */ + public USLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set + 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; + isSetAccountNumber = true; // mark as set + } + + /** + * accountType + * + * @param accountType + * @return the current {@code USLocalAccountIdentification} instance, allowing for method chaining + */ + public USLocalAccountIdentification accountType(USLocalBankAccountType accountType) { + this.accountType = accountType; + isSetAccountType = true; // mark as set + return this; + } + + /** + * Get accountType + * + * @return accountType + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public USLocalBankAccountType getAccountType() { + return accountType; + } + + /** + * accountType + * + * @param accountType + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountType(USLocalBankAccountType accountType) { + this.accountType = accountType; + isSetAccountType = true; // mark as set + } + + /** + * The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without + * separators or whitespace. + * + * @param routingNumber The 9-digit [routing + * number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or + * whitespace. + * @return the current {@code USLocalAccountIdentification} instance, allowing for method chaining + */ + public USLocalAccountIdentification routingNumber(String routingNumber) { + this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set + return this; + } + + /** + * The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without + * separators or whitespace. + * + * @return routingNumber The 9-digit [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 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without + * separators or whitespace. + * + * @param routingNumber The 9-digit [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; + isSetRoutingNumber = true; // mark as set + } + + /** + * **usLocal** + * + * @param type **usLocal** + * @return the current {@code USLocalAccountIdentification} instance, allowing for method chaining + */ + public USLocalAccountIdentification type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **usLocal** + * + * @return type **usLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * **usLocal** + * + * @param type **usLocal** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public USLocalAccountIdentification includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this USLocalAccountIdentification object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + USLocalAccountIdentification usLocalAccountIdentification = (USLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, usLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, usLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.accountType, usLocalAccountIdentification.accountType) + && Objects.equals(this.isSetAccountType, usLocalAccountIdentification.isSetAccountType) + && Objects.equals(this.routingNumber, usLocalAccountIdentification.routingNumber) + && Objects.equals(this.isSetRoutingNumber, usLocalAccountIdentification.isSetRoutingNumber) + && Objects.equals(this.type, usLocalAccountIdentification.type) + && Objects.equals(this.isSetType, usLocalAccountIdentification.isSetType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + accountNumber, + isSetAccountNumber, + accountType, + isSetAccountType, + routingNumber, + isSetRoutingNumber, + type, + isSetType, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class USLocalAccountIdentification {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" routingNumber: ").append(toIndentedString(routingNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("USLocalAccountIdentification", USLocalAccountIdentification.class); + JSON.registerDiscriminator(USLocalAccountIdentification.class, "type", mappings); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of USLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of USLocalAccountIdentification + * @throws JsonProcessingException if the JSON string is invalid with respect to + * USLocalAccountIdentification + */ + public static USLocalAccountIdentification fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, USLocalAccountIdentification.class); + } + + /** + * Convert an instance of USLocalAccountIdentification 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/capital/USLocalBankAccountType.java b/src/main/java/com/adyen/model/capital/USLocalBankAccountType.java new file mode 100644 index 000000000..6fc8a28fd --- /dev/null +++ b/src/main/java/com/adyen/model/capital/USLocalBankAccountType.java @@ -0,0 +1,49 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * 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.capital; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; + +/** Gets or Sets USLocalBankAccountType */ +public enum USLocalBankAccountType { + CHECKING("checking"), + + SAVINGS("savings"); + + private String value; + + USLocalBankAccountType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static USLocalBankAccountType fromValue(String value) { + for (USLocalBankAccountType b : USLocalBankAccountType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/adyen/service/capital/GrantAccountsApi.java b/src/main/java/com/adyen/service/capital/GrantAccountsApi.java new file mode 100644 index 000000000..352627721 --- /dev/null +++ b/src/main/java/com/adyen/service/capital/GrantAccountsApi.java @@ -0,0 +1,89 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.capital; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.RequestOptions; +import com.adyen.model.capital.GrantAccount; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class GrantAccountsApi extends Service { + + public static final String API_VERSION = "1"; + + protected String baseURL; + + /** + * Grant accounts constructor in {@link com.adyen.service.capital package}. + * + * @param client {@link Client } (required) + */ + public GrantAccountsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/capital/v1"); + } + + /** + * Grant accounts constructor in {@link com.adyen.service.capital package}. Please use this + * constructor only if you would like to pass along your own url for routing or testing purposes. + * The latest API version is defined in this class as a constant. + * + * @param client {@link Client } (required) + * @param baseURL {@link String } (required) + */ + public GrantAccountsApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Get the information of your grant account + * + * @param id {@link String } The unique identifier of the grant account. (required) + * @return {@link GrantAccount } + * @throws ApiException if fails to make API call + */ + public GrantAccount getGrantAccountInformation(String id) throws ApiException, IOException { + return getGrantAccountInformation(id, null); + } + + /** + * Get the information of your grant account + * + * @param id {@link String } The unique identifier of the grant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link GrantAccount } + * @throws ApiException if fails to make API call + */ + public GrantAccount getGrantAccountInformation(String id, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grantAccounts/{id}", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return GrantAccount.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/capital/GrantOffersApi.java b/src/main/java/com/adyen/service/capital/GrantOffersApi.java new file mode 100644 index 000000000..28e2d0357 --- /dev/null +++ b/src/main/java/com/adyen/service/capital/GrantOffersApi.java @@ -0,0 +1,126 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.capital; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.RequestOptions; +import com.adyen.model.capital.GrantOffer; +import com.adyen.model.capital.GrantOffers; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class GrantOffersApi extends Service { + + public static final String API_VERSION = "1"; + + protected String baseURL; + + /** + * Grant offers constructor in {@link com.adyen.service.capital package}. + * + * @param client {@link Client } (required) + */ + public GrantOffersApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/capital/v1"); + } + + /** + * Grant offers constructor in {@link com.adyen.service.capital package}. Please use this + * constructor only if you would like to pass along your own url for routing or testing purposes. + * The latest API version is defined in this class as a constant. + * + * @param client {@link Client } (required) + * @param baseURL {@link String } (required) + */ + public GrantOffersApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Get all available grant offers + * + * @return {@link GrantOffers } + * @throws ApiException if fails to make API call + */ + public GrantOffers getAllGrantOffers() throws ApiException, IOException { + return getAllGrantOffers(null, null); + } + + /** + * Get all available grant offers + * + * @param accountHolderId {@link String } Query: The unique identifier of the account holder for + * which you want to get the available grant offers. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link GrantOffers } + * @throws ApiException if fails to make API call + */ + public GrantOffers getAllGrantOffers(String accountHolderId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add query params + Map queryParams = new HashMap<>(); + if (accountHolderId != null) { + queryParams.put("accountHolderId", accountHolderId); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grantOffers", null); + String jsonResult = + resource.request( + requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return GrantOffers.fromJson(jsonResult); + } + + /** + * Get the details of a grant offer + * + * @param id {@link String } The unique identifier of the grant offer. (required) + * @return {@link GrantOffer } + * @throws ApiException if fails to make API call + */ + public GrantOffer getGrantOffer(String id) throws ApiException, IOException { + return getGrantOffer(id, null); + } + + /** + * Get the details of a grant offer + * + * @param id {@link String } The unique identifier of the grant offer. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link GrantOffer } + * @throws ApiException if fails to make API call + */ + public GrantOffer getGrantOffer(String id, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grantOffers/{id}", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return GrantOffer.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/capital/GrantsApi.java b/src/main/java/com/adyen/service/capital/GrantsApi.java new file mode 100644 index 000000000..aa8faadcc --- /dev/null +++ b/src/main/java/com/adyen/service/capital/GrantsApi.java @@ -0,0 +1,293 @@ +/* + * Capital API + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.capital; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.RequestOptions; +import com.adyen.model.capital.Disbursement; +import com.adyen.model.capital.DisbursementInfoUpdate; +import com.adyen.model.capital.Disbursements; +import com.adyen.model.capital.Grant; +import com.adyen.model.capital.GrantInfo; +import com.adyen.model.capital.Grants; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class GrantsApi extends Service { + + public static final String API_VERSION = "1"; + + protected String baseURL; + + /** + * Grants constructor in {@link com.adyen.service.capital package}. + * + * @param client {@link Client } (required) + */ + public GrantsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/capital/v1"); + } + + /** + * Grants constructor in {@link com.adyen.service.capital package}. Please use this constructor + * only if you would like to pass along your own url for routing or testing purposes. The latest + * API version is defined in this class as a constant. + * + * @param client {@link Client } (required) + * @param baseURL {@link String } (required) + */ + public GrantsApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Get all the disbursements of a grant + * + * @param grantId {@link String } The unique identifier of the grant reference. (required) + * @return {@link Disbursements } + * @throws ApiException if fails to make API call + */ + public Disbursements getAllGrantDisbursements(String grantId) throws ApiException, IOException { + return getAllGrantDisbursements(grantId, null); + } + + /** + * Get all the disbursements of a grant + * + * @param grantId {@link String } The unique identifier of the grant reference. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link Disbursements } + * @throws ApiException if fails to make API call + */ + public Disbursements getAllGrantDisbursements(String grantId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (grantId == null) { + throw new IllegalArgumentException("Please provide the grantId path parameter"); + } + pathParams.put("grantId", grantId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grants/{grantId}/disbursements", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Disbursements.fromJson(jsonResult); + } + + /** + * Get all the grants of an account holder + * + * @param counterpartyAccountHolderId {@link String } Query: The unique identifier of the account + * holder that received the grants. (required) + * @return {@link Grants } + * @throws ApiException if fails to make API call + */ + public Grants getAllGrants(String counterpartyAccountHolderId) throws ApiException, IOException { + return getAllGrants(counterpartyAccountHolderId, null); + } + + /** + * Get all the grants of an account holder + * + * @param counterpartyAccountHolderId {@link String } Query: The unique identifier of the account + * holder that received the grants. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link Grants } + * @throws ApiException if fails to make API call + */ + public Grants getAllGrants(String counterpartyAccountHolderId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add query params + Map queryParams = new HashMap<>(); + if (counterpartyAccountHolderId != null) { + queryParams.put("counterpartyAccountHolderId", counterpartyAccountHolderId); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grants", null); + String jsonResult = + resource.request( + requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return Grants.fromJson(jsonResult); + } + + /** + * Get the details of a grant + * + * @param grantId {@link String } The unique identifier of the grant reference. (required) + * @return {@link Grant } + * @throws ApiException if fails to make API call + */ + public Grant getGrant(String grantId) throws ApiException, IOException { + return getGrant(grantId, null); + } + + /** + * Get the details of a grant + * + * @param grantId {@link String } The unique identifier of the grant reference. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link Grant } + * @throws ApiException if fails to make API call + */ + public Grant getGrant(String grantId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (grantId == null) { + throw new IllegalArgumentException("Please provide the grantId path parameter"); + } + pathParams.put("grantId", grantId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grants/{grantId}", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Grant.fromJson(jsonResult); + } + + /** + * Get disbursement details + * + * @param grantId {@link String } The unique identifier of the grant reference. (required) + * @param disbursementId {@link String } The unique identifier of the disbursement. (required) + * @return {@link Disbursement } + * @throws ApiException if fails to make API call + */ + public Disbursement getGrantDisbursement(String grantId, String disbursementId) + throws ApiException, IOException { + return getGrantDisbursement(grantId, disbursementId, null); + } + + /** + * Get disbursement details + * + * @param grantId {@link String } The unique identifier of the grant reference. (required) + * @param disbursementId {@link String } The unique identifier of the disbursement. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link Disbursement } + * @throws ApiException if fails to make API call + */ + public Disbursement getGrantDisbursement( + String grantId, String disbursementId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (grantId == null) { + throw new IllegalArgumentException("Please provide the grantId path parameter"); + } + pathParams.put("grantId", grantId); + if (disbursementId == null) { + throw new IllegalArgumentException("Please provide the disbursementId path parameter"); + } + pathParams.put("disbursementId", disbursementId); + + String requestBody = null; + Resource resource = + new Resource(this, this.baseURL + "/grants/{grantId}/disbursements/{disbursementId}", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Disbursement.fromJson(jsonResult); + } + + /** + * Make a request for a grant + * + * @param grantInfo {@link GrantInfo } (required) + * @return {@link Grant } + * @throws ApiException if fails to make API call + */ + public Grant requestGrant(GrantInfo grantInfo) throws ApiException, IOException { + return requestGrant(grantInfo, null); + } + + /** + * Make a request for a grant + * + * @param grantInfo {@link GrantInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link Grant } + * @throws ApiException if fails to make API call + */ + public Grant requestGrant(GrantInfo grantInfo, RequestOptions requestOptions) + throws ApiException, IOException { + String requestBody = grantInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/grants", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return Grant.fromJson(jsonResult); + } + + /** + * Update the repayment configuration of a disbursement + * + * @param grantId {@link String } The unique identifier of the grant reference. (required) + * @param disbursementId {@link String } The unique identifier of the disbursement. (required) + * @param disbursementInfoUpdate {@link DisbursementInfoUpdate } (required) + * @return {@link Disbursement } + * @throws ApiException if fails to make API call + */ + public Disbursement updateGrantDisbursement( + String grantId, String disbursementId, DisbursementInfoUpdate disbursementInfoUpdate) + throws ApiException, IOException { + return updateGrantDisbursement(grantId, disbursementId, disbursementInfoUpdate, null); + } + + /** + * Update the repayment configuration of a disbursement + * + * @param grantId {@link String } The unique identifier of the grant reference. (required) + * @param disbursementId {@link String } The unique identifier of the disbursement. (required) + * @param disbursementInfoUpdate {@link DisbursementInfoUpdate } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link Disbursement } + * @throws ApiException if fails to make API call + */ + public Disbursement updateGrantDisbursement( + String grantId, + String disbursementId, + DisbursementInfoUpdate disbursementInfoUpdate, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (grantId == null) { + throw new IllegalArgumentException("Please provide the grantId path parameter"); + } + pathParams.put("grantId", grantId); + if (disbursementId == null) { + throw new IllegalArgumentException("Please provide the disbursementId path parameter"); + } + pathParams.put("disbursementId", disbursementId); + + String requestBody = disbursementInfoUpdate.toJson(); + Resource resource = + new Resource(this, this.baseURL + "/grants/{grantId}/disbursements/{disbursementId}", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return Disbursement.fromJson(jsonResult); + } +}