From 1a35dee243490ec5c4688cb26c7ed62c55a91949 Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis Date: Fri, 4 Aug 2023 14:36:23 +0200 Subject: [PATCH 1/6] Remove capital old models (#1102) --- .../model/capital/AbstractOpenApiSchema.java | 145 ----- .../java/com/adyen/model/capital/Amount.java | 253 -------- .../adyen/model/capital/CapitalBalance.java | 313 ---------- .../com/adyen/model/capital/CapitalGrant.java | 548 ------------------ .../adyen/model/capital/CapitalGrantInfo.java | 291 ---------- .../adyen/model/capital/CapitalGrants.java | 239 -------- .../com/adyen/model/capital/Counterparty.java | 281 --------- .../java/com/adyen/model/capital/Fee.java | 224 ------- .../com/adyen/model/capital/InvalidField.java | 291 ---------- .../java/com/adyen/model/capital/JSON.java | 413 ------------- .../com/adyen/model/capital/JSONObject.java | 267 --------- .../com/adyen/model/capital/JSONPath.java | 225 ------- .../com/adyen/model/capital/Repayment.java | 287 --------- .../adyen/model/capital/RepaymentTerm.java | 248 -------- .../adyen/model/capital/RestServiceError.java | 507 ---------------- .../model/capital/ThresholdRepayment.java | 224 ------- 16 files changed, 4756 deletions(-) delete mode 100644 src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java delete mode 100644 src/main/java/com/adyen/model/capital/Amount.java delete mode 100644 src/main/java/com/adyen/model/capital/CapitalBalance.java delete mode 100644 src/main/java/com/adyen/model/capital/CapitalGrant.java delete mode 100644 src/main/java/com/adyen/model/capital/CapitalGrantInfo.java delete mode 100644 src/main/java/com/adyen/model/capital/CapitalGrants.java delete mode 100644 src/main/java/com/adyen/model/capital/Counterparty.java delete mode 100644 src/main/java/com/adyen/model/capital/Fee.java delete mode 100644 src/main/java/com/adyen/model/capital/InvalidField.java delete mode 100644 src/main/java/com/adyen/model/capital/JSON.java delete mode 100644 src/main/java/com/adyen/model/capital/JSONObject.java delete mode 100644 src/main/java/com/adyen/model/capital/JSONPath.java delete mode 100644 src/main/java/com/adyen/model/capital/Repayment.java delete mode 100644 src/main/java/com/adyen/model/capital/RepaymentTerm.java delete mode 100644 src/main/java/com/adyen/model/capital/RestServiceError.java delete mode 100644 src/main/java/com/adyen/model/capital/ThresholdRepayment.java diff --git a/src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java deleted file mode 100644 index 66f0ed9f8..000000000 --- a/src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.lang.reflect.Type; -import java.util.Map; -import jakarta.ws.rs.core.GenericType; - -/** - * 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; - - 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() { - if (Boolean.TRUE.equals(isNullable)) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } - - - -} diff --git a/src/main/java/com/adyen/model/capital/Amount.java b/src/main/java/com/adyen/model/capital/Amount.java deleted file mode 100644 index 6e7d448a4..000000000 --- a/src/main/java/com/adyen/model/capital/Amount.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * Amount - */ - -public class Amount { - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private Long value; - - public Amount() { - } - - public Amount currency(String currency) { - - this.currency = currency; - return this; - } - - /** - * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). - * @return currency - **/ - @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") - - public String getCurrency() { - return currency; - } - - - public void setCurrency(String currency) { - this.currency = currency; - } - - - public Amount value(Long value) { - - this.value = value; - return this; - } - - /** - * The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). - * @return value - **/ - @ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).") - - public Long getValue() { - return value; - } - - - public void setValue(Long value) { - this.value = value; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Amount amount = (Amount) o; - return Objects.equals(this.currency, amount.currency) && - Objects.equals(this.value, amount.value); - } - - @Override - public int hashCode() { - return Objects.hash(currency, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Amount {\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("currency"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("currency"); - openapiRequiredFields.add("value"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(Amount.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Amount - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Amount.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Amount is not found in the empty JSON string", Amount.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Amount.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Amount.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field currency - if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Amount.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Amount' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Amount.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Amount value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Amount read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Amount given an JSON string - * - * @param jsonString JSON string - * @return An instance of Amount - * @throws IOException if the JSON string is invalid with respect to Amount - */ - public static Amount fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Amount.class); - } - - /** - * Convert an instance of Amount to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/CapitalBalance.java b/src/main/java/com/adyen/model/capital/CapitalBalance.java deleted file mode 100644 index d9084a3ef..000000000 --- a/src/main/java/com/adyen/model/capital/CapitalBalance.java +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * CapitalBalance - */ - -public class CapitalBalance { - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_FEE = "fee"; - @SerializedName(SERIALIZED_NAME_FEE) - private Long fee; - - public static final String SERIALIZED_NAME_PRINCIPAL = "principal"; - @SerializedName(SERIALIZED_NAME_PRINCIPAL) - private Long principal; - - public static final String SERIALIZED_NAME_TOTAL = "total"; - @SerializedName(SERIALIZED_NAME_TOTAL) - private Long total; - - public CapitalBalance() { - } - - public CapitalBalance currency(String currency) { - - this.currency = currency; - return this; - } - - /** - * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). - * @return currency - **/ - @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") - - public String getCurrency() { - return currency; - } - - - public void setCurrency(String currency) { - this.currency = currency; - } - - - public CapitalBalance fee(Long fee) { - - this.fee = fee; - return this; - } - - /** - * Fee amount. - * @return fee - **/ - @ApiModelProperty(required = true, value = "Fee amount.") - - public Long getFee() { - return fee; - } - - - public void setFee(Long fee) { - this.fee = fee; - } - - - public CapitalBalance principal(Long principal) { - - this.principal = principal; - return this; - } - - /** - * Principal amount. - * @return principal - **/ - @ApiModelProperty(required = true, value = "Principal amount.") - - public Long getPrincipal() { - return principal; - } - - - public void setPrincipal(Long principal) { - this.principal = principal; - } - - - public CapitalBalance total(Long total) { - - this.total = total; - return this; - } - - /** - * Total amount. A sum of principal amount and fee amount. - * @return total - **/ - @ApiModelProperty(required = true, value = "Total amount. A sum of principal amount and fee amount.") - - public Long getTotal() { - return total; - } - - - public void setTotal(Long total) { - this.total = total; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CapitalBalance capitalBalance = (CapitalBalance) o; - return Objects.equals(this.currency, capitalBalance.currency) && - Objects.equals(this.fee, capitalBalance.fee) && - Objects.equals(this.principal, capitalBalance.principal) && - Objects.equals(this.total, capitalBalance.total); - } - - @Override - public int hashCode() { - return Objects.hash(currency, fee, principal, total); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CapitalBalance {\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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("currency"); - openapiFields.add("fee"); - openapiFields.add("principal"); - openapiFields.add("total"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("currency"); - openapiRequiredFields.add("fee"); - openapiRequiredFields.add("principal"); - openapiRequiredFields.add("total"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(CapitalBalance.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CapitalBalance - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (CapitalBalance.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalBalance is not found in the empty JSON string", CapitalBalance.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CapitalBalance.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalBalance` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CapitalBalance.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field currency - if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CapitalBalance.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CapitalBalance' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CapitalBalance.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CapitalBalance value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CapitalBalance read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CapitalBalance given an JSON string - * - * @param jsonString JSON string - * @return An instance of CapitalBalance - * @throws IOException if the JSON string is invalid with respect to CapitalBalance - */ - public static CapitalBalance fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CapitalBalance.class); - } - - /** - * Convert an instance of CapitalBalance to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/CapitalGrant.java b/src/main/java/com/adyen/model/capital/CapitalGrant.java deleted file mode 100644 index f2175d3e4..000000000 --- a/src/main/java/com/adyen/model/capital/CapitalGrant.java +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.adyen.model.capital.Amount; -import com.adyen.model.capital.CapitalBalance; -import com.adyen.model.capital.Counterparty; -import com.adyen.model.capital.Fee; -import com.adyen.model.capital.Repayment; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * CapitalGrant - */ - -public class CapitalGrant { - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private Amount amount; - - public static final String SERIALIZED_NAME_BALANCES = "balances"; - @SerializedName(SERIALIZED_NAME_BALANCES) - private CapitalBalance balances; - - public static final String SERIALIZED_NAME_COUNTERPARTY = "counterparty"; - @SerializedName(SERIALIZED_NAME_COUNTERPARTY) - private Counterparty counterparty; - - public static final String SERIALIZED_NAME_FEE = "fee"; - @SerializedName(SERIALIZED_NAME_FEE) - private Fee fee; - - public static final String SERIALIZED_NAME_GRANT_ACCOUNT_ID = "grantAccountId"; - @SerializedName(SERIALIZED_NAME_GRANT_ACCOUNT_ID) - private String grantAccountId; - - public static final String SERIALIZED_NAME_GRANT_OFFER_ID = "grantOfferId"; - @SerializedName(SERIALIZED_NAME_GRANT_OFFER_ID) - private String grantOfferId; - - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - public static final String SERIALIZED_NAME_REPAYMENT = "repayment"; - @SerializedName(SERIALIZED_NAME_REPAYMENT) - private Repayment repayment; - - /** - * The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PENDING("Pending"), - - ACTIVE("Active"), - - REPAID("Repaid"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; - - public CapitalGrant() { - } - - public CapitalGrant amount(Amount amount) { - - this.amount = amount; - return this; - } - - /** - * Get amount - * @return amount - **/ - @ApiModelProperty(value = "") - - public Amount getAmount() { - return amount; - } - - - public void setAmount(Amount amount) { - this.amount = amount; - } - - - public CapitalGrant balances(CapitalBalance balances) { - - this.balances = balances; - return this; - } - - /** - * Get balances - * @return balances - **/ - @ApiModelProperty(required = true, value = "") - - public CapitalBalance getBalances() { - return balances; - } - - - public void setBalances(CapitalBalance balances) { - this.balances = balances; - } - - - public CapitalGrant counterparty(Counterparty counterparty) { - - this.counterparty = counterparty; - return this; - } - - /** - * Get counterparty - * @return counterparty - **/ - @ApiModelProperty(value = "") - - public Counterparty getCounterparty() { - return counterparty; - } - - - public void setCounterparty(Counterparty counterparty) { - this.counterparty = counterparty; - } - - - public CapitalGrant fee(Fee fee) { - - this.fee = fee; - return this; - } - - /** - * Get fee - * @return fee - **/ - @ApiModelProperty(value = "") - - public Fee getFee() { - return fee; - } - - - public void setFee(Fee fee) { - this.fee = fee; - } - - - public CapitalGrant grantAccountId(String grantAccountId) { - - this.grantAccountId = grantAccountId; - return this; - } - - /** - * The identifier of the grant account used for the grant. - * @return grantAccountId - **/ - @ApiModelProperty(required = true, value = "The identifier of the grant account used for the grant.") - - public String getGrantAccountId() { - return grantAccountId; - } - - - public void setGrantAccountId(String grantAccountId) { - this.grantAccountId = grantAccountId; - } - - - public CapitalGrant grantOfferId(String grantOfferId) { - - this.grantOfferId = grantOfferId; - return this; - } - - /** - * The identifier of the grant offer that has been selected and from which the grant details will be used. - * @return grantOfferId - **/ - @ApiModelProperty(required = true, value = "The identifier of the grant offer that has been selected and from which the grant details will be used.") - - public String getGrantOfferId() { - return grantOfferId; - } - - - public void setGrantOfferId(String grantOfferId) { - this.grantOfferId = grantOfferId; - } - - - public CapitalGrant id(String id) { - - this.id = id; - return this; - } - - /** - * The identifier of the grant reference. - * @return id - **/ - @ApiModelProperty(required = true, value = "The identifier of the grant reference.") - - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } - - - public CapitalGrant repayment(Repayment repayment) { - - this.repayment = repayment; - return this; - } - - /** - * Get repayment - * @return repayment - **/ - @ApiModelProperty(value = "") - - public Repayment getRepayment() { - return repayment; - } - - - public void setRepayment(Repayment repayment) { - this.repayment = repayment; - } - - - public CapitalGrant status(StatusEnum status) { - - this.status = status; - return this; - } - - /** - * The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**. - * @return status - **/ - @ApiModelProperty(required = true, value = "The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**.") - - public StatusEnum getStatus() { - return status; - } - - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CapitalGrant capitalGrant = (CapitalGrant) o; - return Objects.equals(this.amount, capitalGrant.amount) && - Objects.equals(this.balances, capitalGrant.balances) && - Objects.equals(this.counterparty, capitalGrant.counterparty) && - Objects.equals(this.fee, capitalGrant.fee) && - Objects.equals(this.grantAccountId, capitalGrant.grantAccountId) && - Objects.equals(this.grantOfferId, capitalGrant.grantOfferId) && - Objects.equals(this.id, capitalGrant.id) && - Objects.equals(this.repayment, capitalGrant.repayment) && - Objects.equals(this.status, capitalGrant.status); - } - - @Override - public int hashCode() { - return Objects.hash(amount, balances, counterparty, fee, grantAccountId, grantOfferId, id, repayment, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CapitalGrant {\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(" fee: ").append(toIndentedString(fee)).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(" repayment: ").append(toIndentedString(repayment)).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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("amount"); - openapiFields.add("balances"); - openapiFields.add("counterparty"); - openapiFields.add("fee"); - openapiFields.add("grantAccountId"); - openapiFields.add("grantOfferId"); - openapiFields.add("id"); - openapiFields.add("repayment"); - openapiFields.add("status"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("balances"); - openapiRequiredFields.add("grantAccountId"); - openapiRequiredFields.add("grantOfferId"); - openapiRequiredFields.add("id"); - openapiRequiredFields.add("status"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(CapitalGrant.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CapitalGrant - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (CapitalGrant.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalGrant is not found in the empty JSON string", CapitalGrant.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CapitalGrant.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalGrant` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CapitalGrant.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `amount` - if (jsonObj.getAsJsonObject("amount") != null) { - Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); - } - // validate the optional field `balances` - if (jsonObj.getAsJsonObject("balances") != null) { - CapitalBalance.validateJsonObject(jsonObj.getAsJsonObject("balances")); - } - // validate the optional field `counterparty` - if (jsonObj.getAsJsonObject("counterparty") != null) { - Counterparty.validateJsonObject(jsonObj.getAsJsonObject("counterparty")); - } - // validate the optional field `fee` - if (jsonObj.getAsJsonObject("fee") != null) { - Fee.validateJsonObject(jsonObj.getAsJsonObject("fee")); - } - // validate the optional field grantAccountId - if (jsonObj.get("grantAccountId") != null && !jsonObj.get("grantAccountId").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `grantAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantAccountId").toString())); - } - // validate the optional field grantOfferId - if (jsonObj.get("grantOfferId") != null && !jsonObj.get("grantOfferId").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `grantOfferId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantOfferId").toString())); - } - // validate the optional field id - if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); - } - // validate the optional field `repayment` - if (jsonObj.getAsJsonObject("repayment") != null) { - Repayment.validateJsonObject(jsonObj.getAsJsonObject("repayment")); - } - // ensure the field status can be parsed to an enum value - if (jsonObj.get("status") != null) { - if(!jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); - } - StatusEnum.fromValue(jsonObj.get("status").getAsString()); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CapitalGrant.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CapitalGrant' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CapitalGrant.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CapitalGrant value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CapitalGrant read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CapitalGrant given an JSON string - * - * @param jsonString JSON string - * @return An instance of CapitalGrant - * @throws IOException if the JSON string is invalid with respect to CapitalGrant - */ - public static CapitalGrant fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CapitalGrant.class); - } - - /** - * Convert an instance of CapitalGrant to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java b/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java deleted file mode 100644 index 6f71421aa..000000000 --- a/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.adyen.model.capital.Counterparty; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * CapitalGrantInfo - */ - -public class CapitalGrantInfo { - public static final String SERIALIZED_NAME_COUNTERPARTY = "counterparty"; - @SerializedName(SERIALIZED_NAME_COUNTERPARTY) - private Counterparty counterparty; - - public static final String SERIALIZED_NAME_GRANT_ACCOUNT_ID = "grantAccountId"; - @SerializedName(SERIALIZED_NAME_GRANT_ACCOUNT_ID) - private String grantAccountId; - - public static final String SERIALIZED_NAME_GRANT_OFFER_ID = "grantOfferId"; - @SerializedName(SERIALIZED_NAME_GRANT_OFFER_ID) - private String grantOfferId; - - public CapitalGrantInfo() { - } - - public CapitalGrantInfo counterparty(Counterparty counterparty) { - - this.counterparty = counterparty; - return this; - } - - /** - * Get counterparty - * @return counterparty - **/ - @ApiModelProperty(value = "") - - public Counterparty getCounterparty() { - return counterparty; - } - - - public void setCounterparty(Counterparty counterparty) { - this.counterparty = counterparty; - } - - - public CapitalGrantInfo grantAccountId(String grantAccountId) { - - this.grantAccountId = grantAccountId; - return this; - } - - /** - * The identifier of the grant account used for the grant. - * @return grantAccountId - **/ - @ApiModelProperty(required = true, value = "The identifier of the grant account used for the grant.") - - public String getGrantAccountId() { - return grantAccountId; - } - - - public void setGrantAccountId(String grantAccountId) { - this.grantAccountId = grantAccountId; - } - - - public CapitalGrantInfo grantOfferId(String grantOfferId) { - - this.grantOfferId = grantOfferId; - return this; - } - - /** - * The identifier of the grant offer that has been selected and from which the grant details will be used. - * @return grantOfferId - **/ - @ApiModelProperty(required = true, value = "The identifier of the grant offer that has been selected and from which the grant details will be used.") - - public String getGrantOfferId() { - return grantOfferId; - } - - - public void setGrantOfferId(String grantOfferId) { - this.grantOfferId = grantOfferId; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CapitalGrantInfo capitalGrantInfo = (CapitalGrantInfo) o; - return Objects.equals(this.counterparty, capitalGrantInfo.counterparty) && - Objects.equals(this.grantAccountId, capitalGrantInfo.grantAccountId) && - Objects.equals(this.grantOfferId, capitalGrantInfo.grantOfferId); - } - - @Override - public int hashCode() { - return Objects.hash(counterparty, grantAccountId, grantOfferId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CapitalGrantInfo {\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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("counterparty"); - openapiFields.add("grantAccountId"); - openapiFields.add("grantOfferId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("grantAccountId"); - openapiRequiredFields.add("grantOfferId"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(CapitalGrantInfo.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CapitalGrantInfo - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (CapitalGrantInfo.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalGrantInfo is not found in the empty JSON string", CapitalGrantInfo.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CapitalGrantInfo.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalGrantInfo` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CapitalGrantInfo.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `counterparty` - if (jsonObj.getAsJsonObject("counterparty") != null) { - Counterparty.validateJsonObject(jsonObj.getAsJsonObject("counterparty")); - } - // validate the optional field grantAccountId - if (jsonObj.get("grantAccountId") != null && !jsonObj.get("grantAccountId").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `grantAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantAccountId").toString())); - } - // validate the optional field grantOfferId - if (jsonObj.get("grantOfferId") != null && !jsonObj.get("grantOfferId").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `grantOfferId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantOfferId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CapitalGrantInfo.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CapitalGrantInfo' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CapitalGrantInfo.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CapitalGrantInfo value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CapitalGrantInfo read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CapitalGrantInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of CapitalGrantInfo - * @throws IOException if the JSON string is invalid with respect to CapitalGrantInfo - */ - public static CapitalGrantInfo fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CapitalGrantInfo.class); - } - - /** - * Convert an instance of CapitalGrantInfo to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/CapitalGrants.java b/src/main/java/com/adyen/model/capital/CapitalGrants.java deleted file mode 100644 index e3253c499..000000000 --- a/src/main/java/com/adyen/model/capital/CapitalGrants.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.adyen.model.capital.CapitalGrant; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * CapitalGrants - */ - -public class CapitalGrants { - public static final String SERIALIZED_NAME_GRANTS = "grants"; - @SerializedName(SERIALIZED_NAME_GRANTS) - private List grants = new ArrayList<>(); - - public CapitalGrants() { - } - - public CapitalGrants grants(List grants) { - - this.grants = grants; - return this; - } - - public CapitalGrants addGrantsItem(CapitalGrant grantsItem) { - this.grants.add(grantsItem); - return this; - } - - /** - * The unique identifier of the grant. - * @return grants - **/ - @ApiModelProperty(required = true, value = "The unique identifier of the grant.") - - public List getGrants() { - return grants; - } - - - public void setGrants(List grants) { - this.grants = grants; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CapitalGrants capitalGrants = (CapitalGrants) o; - return Objects.equals(this.grants, capitalGrants.grants); - } - - @Override - public int hashCode() { - return Objects.hash(grants); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CapitalGrants {\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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("grants"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("grants"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(CapitalGrants.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CapitalGrants - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (CapitalGrants.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalGrants is not found in the empty JSON string", CapitalGrants.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CapitalGrants.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalGrants` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CapitalGrants.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - JsonArray jsonArraygrants = jsonObj.getAsJsonArray("grants"); - if (jsonArraygrants != null) { - // ensure the json data is an array - if (!jsonObj.get("grants").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `grants` to be an array in the JSON string but got `%s`", jsonObj.get("grants").toString())); - } - - // validate the optional field `grants` (array) - for (int i = 0; i < jsonArraygrants.size(); i++) { - CapitalGrant.validateJsonObject(jsonArraygrants.get(i).getAsJsonObject()); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CapitalGrants.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CapitalGrants' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CapitalGrants.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CapitalGrants value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CapitalGrants read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CapitalGrants given an JSON string - * - * @param jsonString JSON string - * @return An instance of CapitalGrants - * @throws IOException if the JSON string is invalid with respect to CapitalGrants - */ - public static CapitalGrants fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CapitalGrants.class); - } - - /** - * Convert an instance of CapitalGrants to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/Counterparty.java b/src/main/java/com/adyen/model/capital/Counterparty.java deleted file mode 100644 index e9eaeda93..000000000 --- a/src/main/java/com/adyen/model/capital/Counterparty.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * Counterparty - */ - -public class Counterparty { - public static final String SERIALIZED_NAME_ACCOUNT_HOLDER_ID = "accountHolderId"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_HOLDER_ID) - private String accountHolderId; - - public static final String SERIALIZED_NAME_BALANCE_ACCOUNT_ID = "balanceAccountId"; - @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT_ID) - private String balanceAccountId; - - public static final String SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; - @SerializedName(SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID) - private String transferInstrumentId; - - public Counterparty() { - } - - public Counterparty accountHolderId(String accountHolderId) { - - this.accountHolderId = accountHolderId; - return this; - } - - /** - * The identifier of the receiving account holder. The payout will default to the primary balance account of this account holder if no `balanceAccountId` is provided. - * @return accountHolderId - **/ - @ApiModelProperty(value = "The identifier of the receiving account holder. The payout will default to the primary balance account of this account holder if no `balanceAccountId` is provided.") - - public String getAccountHolderId() { - return accountHolderId; - } - - - public void setAccountHolderId(String accountHolderId) { - this.accountHolderId = accountHolderId; - } - - - public Counterparty balanceAccountId(String balanceAccountId) { - - this.balanceAccountId = balanceAccountId; - return this; - } - - /** - * The identifier of the balance account that belongs to the receiving account holder. - * @return balanceAccountId - **/ - @ApiModelProperty(value = "The identifier of the balance account that belongs to the receiving account holder.") - - public String getBalanceAccountId() { - return balanceAccountId; - } - - - public void setBalanceAccountId(String balanceAccountId) { - this.balanceAccountId = balanceAccountId; - } - - - public Counterparty transferInstrumentId(String transferInstrumentId) { - - this.transferInstrumentId = transferInstrumentId; - return this; - } - - /** - * The identifier of the transfer instrument that belongs to the legal entity of the account holder. - * @return transferInstrumentId - **/ - @ApiModelProperty(value = "The identifier of the transfer instrument that belongs to the legal entity of the account holder.") - - public String getTransferInstrumentId() { - return transferInstrumentId; - } - - - public void setTransferInstrumentId(String transferInstrumentId) { - this.transferInstrumentId = transferInstrumentId; - } - - - - @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.balanceAccountId, counterparty.balanceAccountId) && - Objects.equals(this.transferInstrumentId, counterparty.transferInstrumentId); - } - - @Override - public int hashCode() { - return Objects.hash(accountHolderId, balanceAccountId, transferInstrumentId); - } - - @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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("accountHolderId"); - openapiFields.add("balanceAccountId"); - openapiFields.add("transferInstrumentId"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(Counterparty.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Counterparty - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Counterparty.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Counterparty is not found in the empty JSON string", Counterparty.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Counterparty.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Counterparty` properties.", entry.getKey())); - } - } - // validate the optional field accountHolderId - if (jsonObj.get("accountHolderId") != null && !jsonObj.get("accountHolderId").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); - } - // validate the optional field balanceAccountId - if (jsonObj.get("balanceAccountId") != null && !jsonObj.get("balanceAccountId").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); - } - // validate the optional field transferInstrumentId - if (jsonObj.get("transferInstrumentId") != null && !jsonObj.get("transferInstrumentId").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Counterparty.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Counterparty' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Counterparty.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Counterparty value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Counterparty read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Counterparty given an JSON string - * - * @param jsonString JSON string - * @return An instance of Counterparty - * @throws IOException if the JSON string is invalid with respect to Counterparty - */ - public static Counterparty fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Counterparty.class); - } - - /** - * Convert an instance of Counterparty to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/Fee.java b/src/main/java/com/adyen/model/capital/Fee.java deleted file mode 100644 index c2243388a..000000000 --- a/src/main/java/com/adyen/model/capital/Fee.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.adyen.model.capital.Amount; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * Fee - */ - -public class Fee { - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private Amount amount; - - public Fee() { - } - - public Fee amount(Amount amount) { - - this.amount = amount; - return this; - } - - /** - * Get amount - * @return amount - **/ - @ApiModelProperty(required = true, value = "") - - public Amount getAmount() { - return amount; - } - - - public void setAmount(Amount amount) { - this.amount = amount; - } - - - - @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); - } - - @Override - public int hashCode() { - return Objects.hash(amount); - } - - @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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("amount"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("amount"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(Fee.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Fee - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Fee.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Fee is not found in the empty JSON string", Fee.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Fee.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Fee` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Fee.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `amount` - if (jsonObj.getAsJsonObject("amount") != null) { - Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Fee.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Fee' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Fee.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Fee value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Fee read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Fee given an JSON string - * - * @param jsonString JSON string - * @return An instance of Fee - * @throws IOException if the JSON string is invalid with respect to Fee - */ - public static Fee fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Fee.class); - } - - /** - * Convert an instance of Fee to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/InvalidField.java b/src/main/java/com/adyen/model/capital/InvalidField.java deleted file mode 100644 index fb54d2d34..000000000 --- a/src/main/java/com/adyen/model/capital/InvalidField.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * InvalidField - */ - -public class InvalidField { - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public InvalidField() { - } - - public InvalidField message(String message) { - - this.message = message; - return this; - } - - /** - * Description of the validation error. - * @return message - **/ - @ApiModelProperty(required = true, value = "Description of the validation error.") - - public String getMessage() { - return message; - } - - - public void setMessage(String message) { - this.message = message; - } - - - public InvalidField name(String name) { - - this.name = name; - return this; - } - - /** - * The field that has an invalid value. - * @return name - **/ - @ApiModelProperty(required = true, value = "The field that has an invalid value.") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public InvalidField value(String value) { - - this.value = value; - return this; - } - - /** - * The invalid value. - * @return value - **/ - @ApiModelProperty(required = true, value = "The invalid value.") - - public String getValue() { - return value; - } - - - public void setValue(String value) { - this.value = value; - } - - - - @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.message, invalidField.message) && - Objects.equals(this.name, invalidField.name) && - Objects.equals(this.value, invalidField.value); - } - - @Override - public int hashCode() { - return Objects.hash(message, name, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class InvalidField {\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - 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 static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("message"); - openapiFields.add("name"); - openapiFields.add("value"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("message"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("value"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(InvalidField.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to InvalidField - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (InvalidField.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in InvalidField is not found in the empty JSON string", InvalidField.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!InvalidField.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InvalidField` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : InvalidField.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field message - if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - // validate the optional field name - if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - // validate the optional field value - if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!InvalidField.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'InvalidField' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(InvalidField.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, InvalidField value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public InvalidField read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of InvalidField given an JSON string - * - * @param jsonString JSON string - * @return An instance of InvalidField - * @throws IOException if the JSON string is invalid with respect to InvalidField - */ - public static InvalidField fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, InvalidField.class); - } - - /** - * Convert an instance of InvalidField to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/JSON.java b/src/main/java/com/adyen/model/capital/JSON.java deleted file mode 100644 index 534331c20..000000000 --- a/src/main/java/com/adyen/model/capital/JSON.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import com.google.gson.JsonElement; -import io.gsonfire.GsonFireBuilder; -import io.gsonfire.TypeSelector; - -import org.apache.commons.codec.binary.Base64; - -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.ParsePosition; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Date; -import java.util.Locale; -import java.util.Map; -import java.util.HashMap; - -/* - * A JSON utility class - * - * NOTE: in the future, this class may be converted to static, which may break - * backward-compatibility - */ -public class JSON { - private static Gson gson; - private static boolean isLenientOnJson = false; - private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); - - @SuppressWarnings("unchecked") - public static GsonBuilder createGson() { - GsonFireBuilder fireBuilder = new GsonFireBuilder() - ; - GsonBuilder builder = fireBuilder.createGsonBuilder(); - return builder; - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if (null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - /** - * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. - * - * @param classByDiscriminatorValue The map of discriminator values to Java classes. - * @param discriminatorValue The value of the OpenAPI discriminator in the input data. - * @return The Java class that implements the OpenAPI schema - */ - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); - if (null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } - - static { - GsonBuilder gsonBuilder = createGson(); - gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); - gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); - gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); - gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); - gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.Amount.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.CapitalBalance.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.CapitalGrant.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.CapitalGrantInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.CapitalGrants.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.Counterparty.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.Fee.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.InvalidField.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.JSONObject.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.JSONPath.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.Repayment.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.RepaymentTerm.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.RestServiceError.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.ThresholdRepayment.CustomTypeAdapterFactory()); - gson = gsonBuilder.create(); - } - - /** - * Get Gson. - * - * @return Gson - */ - public static Gson getGson() { - return gson; - } - - /** - * Set Gson. - * - * @param gson Gson - */ - public static void setGson(Gson gson) { - JSON.gson = gson; - } - - public static void setLenientOnJson(boolean lenientOnJson) { - isLenientOnJson = lenientOnJson; - } - - /** - * Serialize the given Java object into JSON string. - * - * @param obj Object - * @return String representation of the JSON - */ - public static String serialize(Object obj) { - return gson.toJson(obj); - } - - /** - * Deserialize the given JSON string to Java object. - * - * @param Type - * @param body The JSON string - * @param returnType The type to deserialize into - * @return The deserialized Java object - */ - @SuppressWarnings("unchecked") - public static T deserialize(String body, Type returnType) { - try { - if (isLenientOnJson) { - JsonReader jsonReader = new JsonReader(new StringReader(body)); - // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) - jsonReader.setLenient(true); - return gson.fromJson(jsonReader, returnType); - } else { - return gson.fromJson(body, returnType); - } - } catch (JsonParseException e) { - // Fallback processing when failed to parse JSON form response body: - // return the response body string directly for the String return type; - if (returnType.equals(String.class)) { - return (T) body; - } else { - throw (e); - } - } - } - - /** - * Gson TypeAdapter for Byte Array type - */ - public static class ByteArrayAdapter extends TypeAdapter { - - @Override - public void write(JsonWriter out, byte[] value) throws IOException { - if (value == null) { - out.nullValue(); - } else { - out.value(new String(value)); - } - } - - @Override - public byte[] read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String bytesAsBase64 = in.nextString(); - return Base64.decodeBase64(bytesAsBase64); - } - } - } - - /** - * Gson TypeAdapter for JSR310 OffsetDateTime type - */ - public static class OffsetDateTimeTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public OffsetDateTimeTypeAdapter() { - this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - - public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, OffsetDateTime date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public OffsetDateTime read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - if (date.endsWith("+0000")) { - date = date.substring(0, date.length()-5) + "Z"; - } - return OffsetDateTime.parse(date, formatter); - } - } - } - - /** - * Gson TypeAdapter for JSR310 LocalDate type - */ - public static class LocalDateTypeAdapter extends TypeAdapter { - - private DateTimeFormatter formatter; - - public LocalDateTypeAdapter() { - this(DateTimeFormatter.ISO_LOCAL_DATE); - } - - public LocalDateTypeAdapter(DateTimeFormatter formatter) { - this.formatter = formatter; - } - - public void setFormat(DateTimeFormatter dateFormat) { - this.formatter = dateFormat; - } - - @Override - public void write(JsonWriter out, LocalDate date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - out.value(formatter.format(date)); - } - } - - @Override - public LocalDate read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - return LocalDate.parse(date, formatter); - } - } - } - - public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { - offsetDateTimeTypeAdapter.setFormat(dateFormat); - } - - public static void setLocalDateFormat(DateTimeFormatter dateFormat) { - localDateTypeAdapter.setFormat(dateFormat); - } - - /** - * Gson TypeAdapter for java.sql.Date type - * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used - * (more efficient than SimpleDateFormat). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() {} - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - - /** - * Gson TypeAdapter for java.util.Date type - * If the dateFormat is null, ISO8601Utils will be used. - */ - public static class DateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public DateTypeAdapter() {} - - public DateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = ISO8601Utils.format(date, true); - } - out.value(value); - } - } - - @Override - public Date read(JsonReader in) throws IOException { - try { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return dateFormat.parse(date); - } - return ISO8601Utils.parse(date, new ParsePosition(0)); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } catch (IllegalArgumentException e) { - throw new JsonParseException(e); - } - } - } - - public static void setDateFormat(DateFormat dateFormat) { - dateTypeAdapter.setFormat(dateFormat); - } - - public static void setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - } -} diff --git a/src/main/java/com/adyen/model/capital/JSONObject.java b/src/main/java/com/adyen/model/capital/JSONObject.java deleted file mode 100644 index a3ebce9d3..000000000 --- a/src/main/java/com/adyen/model/capital/JSONObject.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.adyen.model.capital.JSONPath; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * JSONObject - */ - -public class JSONObject { - public static final String SERIALIZED_NAME_PATHS = "paths"; - @SerializedName(SERIALIZED_NAME_PATHS) - private List paths = null; - - public static final String SERIALIZED_NAME_ROOT_PATH = "rootPath"; - @SerializedName(SERIALIZED_NAME_ROOT_PATH) - private JSONPath rootPath; - - public JSONObject() { - } - - public JSONObject paths(List paths) { - - this.paths = paths; - return this; - } - - public JSONObject addPathsItem(JSONPath pathsItem) { - if (this.paths == null) { - this.paths = new ArrayList<>(); - } - this.paths.add(pathsItem); - return this; - } - - /** - * Get paths - * @return paths - **/ - @ApiModelProperty(value = "") - - public List getPaths() { - return paths; - } - - - public void setPaths(List paths) { - this.paths = paths; - } - - - public JSONObject rootPath(JSONPath rootPath) { - - this.rootPath = rootPath; - return this; - } - - /** - * Get rootPath - * @return rootPath - **/ - @ApiModelProperty(value = "") - - public JSONPath getRootPath() { - return rootPath; - } - - - public void setRootPath(JSONPath rootPath) { - this.rootPath = rootPath; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JSONObject jsONObject = (JSONObject) o; - return Objects.equals(this.paths, jsONObject.paths) && - Objects.equals(this.rootPath, jsONObject.rootPath); - } - - @Override - public int hashCode() { - return Objects.hash(paths, rootPath); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JSONObject {\n"); - sb.append(" paths: ").append(toIndentedString(paths)).append("\n"); - sb.append(" rootPath: ").append(toIndentedString(rootPath)).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 static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("paths"); - openapiFields.add("rootPath"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(JSONObject.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to JSONObject - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (JSONObject.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in JSONObject is not found in the empty JSON string", JSONObject.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!JSONObject.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONObject` properties.", entry.getKey())); - } - } - JsonArray jsonArraypaths = jsonObj.getAsJsonArray("paths"); - if (jsonArraypaths != null) { - // ensure the json data is an array - if (!jsonObj.get("paths").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `paths` to be an array in the JSON string but got `%s`", jsonObj.get("paths").toString())); - } - - // validate the optional field `paths` (array) - for (int i = 0; i < jsonArraypaths.size(); i++) { - JSONPath.validateJsonObject(jsonArraypaths.get(i).getAsJsonObject()); - } - } - // validate the optional field `rootPath` - if (jsonObj.getAsJsonObject("rootPath") != null) { - JSONPath.validateJsonObject(jsonObj.getAsJsonObject("rootPath")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JSONObject.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JSONObject' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(JSONObject.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, JSONObject value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public JSONObject read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of JSONObject given an JSON string - * - * @param jsonString JSON string - * @return An instance of JSONObject - * @throws IOException if the JSON string is invalid with respect to JSONObject - */ - public static JSONObject fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JSONObject.class); - } - - /** - * Convert an instance of JSONObject to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/JSONPath.java b/src/main/java/com/adyen/model/capital/JSONPath.java deleted file mode 100644 index 22cc84e15..000000000 --- a/src/main/java/com/adyen/model/capital/JSONPath.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * JSONPath - */ - -public class JSONPath { - public static final String SERIALIZED_NAME_CONTENT = "content"; - @SerializedName(SERIALIZED_NAME_CONTENT) - private List content = null; - - public JSONPath() { - } - - public JSONPath content(List content) { - - this.content = content; - return this; - } - - public JSONPath addContentItem(String contentItem) { - if (this.content == null) { - this.content = new ArrayList<>(); - } - this.content.add(contentItem); - return this; - } - - /** - * Get content - * @return content - **/ - @ApiModelProperty(value = "") - - public List getContent() { - return content; - } - - - public void setContent(List content) { - this.content = content; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JSONPath jsONPath = (JSONPath) o; - return Objects.equals(this.content, jsONPath.content); - } - - @Override - public int hashCode() { - return Objects.hash(content); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class JSONPath {\n"); - sb.append(" content: ").append(toIndentedString(content)).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 static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("content"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(JSONPath.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to JSONPath - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (JSONPath.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in JSONPath is not found in the empty JSON string", JSONPath.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!JSONPath.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONPath` properties.", entry.getKey())); - } - } - // ensure the json data is an array - if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonArray()) { - log.log(Level.WARNING, String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!JSONPath.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'JSONPath' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(JSONPath.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, JSONPath value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public JSONPath read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of JSONPath given an JSON string - * - * @param jsonString JSON string - * @return An instance of JSONPath - * @throws IOException if the JSON string is invalid with respect to JSONPath - */ - public static JSONPath fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, JSONPath.class); - } - - /** - * Convert an instance of JSONPath to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/Repayment.java b/src/main/java/com/adyen/model/capital/Repayment.java deleted file mode 100644 index 20068108e..000000000 --- a/src/main/java/com/adyen/model/capital/Repayment.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.adyen.model.capital.RepaymentTerm; -import com.adyen.model.capital.ThresholdRepayment; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * Repayment - */ - -public class Repayment { - public static final String SERIALIZED_NAME_BASIS_POINTS = "basisPoints"; - @SerializedName(SERIALIZED_NAME_BASIS_POINTS) - private Integer basisPoints; - - public static final String SERIALIZED_NAME_TERM = "term"; - @SerializedName(SERIALIZED_NAME_TERM) - private RepaymentTerm term; - - public static final String SERIALIZED_NAME_THRESHOLD = "threshold"; - @SerializedName(SERIALIZED_NAME_THRESHOLD) - private ThresholdRepayment threshold; - - public Repayment() { - } - - public Repayment basisPoints(Integer basisPoints) { - - this.basisPoints = basisPoints; - return this; - } - - /** - * The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). - * @return basisPoints - **/ - @ApiModelProperty(required = true, value = "The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp).") - - public Integer getBasisPoints() { - return basisPoints; - } - - - public void setBasisPoints(Integer basisPoints) { - this.basisPoints = basisPoints; - } - - - public Repayment term(RepaymentTerm term) { - - this.term = term; - return this; - } - - /** - * Get term - * @return term - **/ - @ApiModelProperty(value = "") - - public RepaymentTerm getTerm() { - return term; - } - - - public void setTerm(RepaymentTerm term) { - this.term = term; - } - - - public Repayment threshold(ThresholdRepayment threshold) { - - this.threshold = threshold; - return this; - } - - /** - * Get threshold - * @return threshold - **/ - @ApiModelProperty(value = "") - - public ThresholdRepayment getThreshold() { - return threshold; - } - - - public void setThreshold(ThresholdRepayment threshold) { - this.threshold = threshold; - } - - - - @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.term, repayment.term) && - Objects.equals(this.threshold, repayment.threshold); - } - - @Override - public int hashCode() { - return Objects.hash(basisPoints, term, threshold); - } - - @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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("basisPoints"); - openapiFields.add("term"); - openapiFields.add("threshold"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("basisPoints"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(Repayment.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Repayment - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (Repayment.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Repayment is not found in the empty JSON string", Repayment.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!Repayment.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Repayment` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Repayment.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `term` - if (jsonObj.getAsJsonObject("term") != null) { - RepaymentTerm.validateJsonObject(jsonObj.getAsJsonObject("term")); - } - // validate the optional field `threshold` - if (jsonObj.getAsJsonObject("threshold") != null) { - ThresholdRepayment.validateJsonObject(jsonObj.getAsJsonObject("threshold")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Repayment.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Repayment' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Repayment.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Repayment value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Repayment read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Repayment given an JSON string - * - * @param jsonString JSON string - * @return An instance of Repayment - * @throws IOException if the JSON string is invalid with respect to Repayment - */ - public static Repayment fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Repayment.class); - } - - /** - * Convert an instance of Repayment to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/RepaymentTerm.java b/src/main/java/com/adyen/model/capital/RepaymentTerm.java deleted file mode 100644 index 72f611c3a..000000000 --- a/src/main/java/com/adyen/model/capital/RepaymentTerm.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * RepaymentTerm - */ - -public class RepaymentTerm { - public static final String SERIALIZED_NAME_ESTIMATED_DAYS = "estimatedDays"; - @SerializedName(SERIALIZED_NAME_ESTIMATED_DAYS) - private Integer estimatedDays; - - public static final String SERIALIZED_NAME_MAXIMUM_DAYS = "maximumDays"; - @SerializedName(SERIALIZED_NAME_MAXIMUM_DAYS) - private Integer maximumDays; - - public RepaymentTerm() { - } - - public RepaymentTerm estimatedDays(Integer estimatedDays) { - - this.estimatedDays = estimatedDays; - return this; - } - - /** - * The estimated term for repaying the grant, in days. - * @return estimatedDays - **/ - @ApiModelProperty(required = true, value = "The estimated term for repaying the grant, in days.") - - public Integer getEstimatedDays() { - return estimatedDays; - } - - - public void setEstimatedDays(Integer estimatedDays) { - this.estimatedDays = estimatedDays; - } - - - public RepaymentTerm maximumDays(Integer maximumDays) { - - this.maximumDays = maximumDays; - return this; - } - - /** - * The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**. - * @return maximumDays - **/ - @ApiModelProperty(value = "The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**.") - - public Integer getMaximumDays() { - return maximumDays; - } - - - public void setMaximumDays(Integer maximumDays) { - this.maximumDays = maximumDays; - } - - - - @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.maximumDays, repaymentTerm.maximumDays); - } - - @Override - public int hashCode() { - return Objects.hash(estimatedDays, maximumDays); - } - - @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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("estimatedDays"); - openapiFields.add("maximumDays"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("estimatedDays"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(RepaymentTerm.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to RepaymentTerm - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (RepaymentTerm.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in RepaymentTerm is not found in the empty JSON string", RepaymentTerm.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RepaymentTerm.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RepaymentTerm` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RepaymentTerm.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RepaymentTerm.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RepaymentTerm' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RepaymentTerm.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RepaymentTerm value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RepaymentTerm read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RepaymentTerm given an JSON string - * - * @param jsonString JSON string - * @return An instance of RepaymentTerm - * @throws IOException if the JSON string is invalid with respect to RepaymentTerm - */ - public static RepaymentTerm fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RepaymentTerm.class); - } - - /** - * Convert an instance of RepaymentTerm to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/RestServiceError.java b/src/main/java/com/adyen/model/capital/RestServiceError.java deleted file mode 100644 index 9e954132f..000000000 --- a/src/main/java/com/adyen/model/capital/RestServiceError.java +++ /dev/null @@ -1,507 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.adyen.model.capital.InvalidField; -import com.adyen.model.capital.JSONObject; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * RestServiceError - */ - -public class RestServiceError { - public static final String SERIALIZED_NAME_DETAIL = "detail"; - @SerializedName(SERIALIZED_NAME_DETAIL) - private String detail; - - public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; - @SerializedName(SERIALIZED_NAME_ERROR_CODE) - private String errorCode; - - public static final String SERIALIZED_NAME_INSTANCE = "instance"; - @SerializedName(SERIALIZED_NAME_INSTANCE) - private String instance; - - public static final String SERIALIZED_NAME_INVALID_FIELDS = "invalidFields"; - @SerializedName(SERIALIZED_NAME_INVALID_FIELDS) - private List invalidFields = null; - - public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; - @SerializedName(SERIALIZED_NAME_REQUEST_ID) - private String requestId; - - public static final String SERIALIZED_NAME_RESPONSE = "response"; - @SerializedName(SERIALIZED_NAME_RESPONSE) - private JSONObject response; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private Integer status; - - public static final String SERIALIZED_NAME_TITLE = "title"; - @SerializedName(SERIALIZED_NAME_TITLE) - private String title; - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public RestServiceError() { - } - - public RestServiceError detail(String detail) { - - this.detail = detail; - return this; - } - - /** - * A human-readable explanation specific to this occurrence of the problem. - * @return detail - **/ - @ApiModelProperty(required = true, value = "A human-readable explanation specific to this occurrence of the problem.") - - public String getDetail() { - return detail; - } - - - public void setDetail(String detail) { - this.detail = detail; - } - - - public RestServiceError errorCode(String errorCode) { - - this.errorCode = errorCode; - return this; - } - - /** - * A code that identifies the problem type. - * @return errorCode - **/ - @ApiModelProperty(required = true, value = "A code that identifies the problem type.") - - public String getErrorCode() { - return errorCode; - } - - - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - - - public RestServiceError instance(String instance) { - - this.instance = instance; - return this; - } - - /** - * A unique URI that identifies the specific occurrence of the problem. - * @return instance - **/ - @ApiModelProperty(value = "A unique URI that identifies the specific occurrence of the problem.") - - public String getInstance() { - return instance; - } - - - public void setInstance(String instance) { - this.instance = instance; - } - - - public RestServiceError invalidFields(List invalidFields) { - - this.invalidFields = invalidFields; - return this; - } - - public RestServiceError addInvalidFieldsItem(InvalidField invalidFieldsItem) { - if (this.invalidFields == null) { - this.invalidFields = new ArrayList<>(); - } - this.invalidFields.add(invalidFieldsItem); - return this; - } - - /** - * Detailed explanation of each validation error, when applicable. - * @return invalidFields - **/ - @ApiModelProperty(value = "Detailed explanation of each validation error, when applicable.") - - public List getInvalidFields() { - return invalidFields; - } - - - public void setInvalidFields(List invalidFields) { - this.invalidFields = invalidFields; - } - - - public RestServiceError requestId(String requestId) { - - this.requestId = requestId; - return this; - } - - /** - * A unique reference for the request, essentially the same as `pspReference`. - * @return requestId - **/ - @ApiModelProperty(value = "A unique reference for the request, essentially the same as `pspReference`.") - - public String getRequestId() { - return requestId; - } - - - public void setRequestId(String requestId) { - this.requestId = requestId; - } - - - public RestServiceError response(JSONObject response) { - - this.response = response; - return this; - } - - /** - * Get response - * @return response - **/ - @ApiModelProperty(value = "") - - public JSONObject getResponse() { - return response; - } - - - public void setResponse(JSONObject response) { - this.response = response; - } - - - public RestServiceError status(Integer status) { - - this.status = status; - return this; - } - - /** - * The HTTP status code. - * @return status - **/ - @ApiModelProperty(required = true, value = "The HTTP status code.") - - public Integer getStatus() { - return status; - } - - - public void setStatus(Integer status) { - this.status = status; - } - - - public RestServiceError title(String title) { - - this.title = title; - return this; - } - - /** - * A short, human-readable summary of the problem type. - * @return title - **/ - @ApiModelProperty(required = true, value = "A short, human-readable summary of the problem type.") - - public String getTitle() { - return title; - } - - - public void setTitle(String title) { - this.title = title; - } - - - public RestServiceError type(String type) { - - this.type = type; - return this; - } - - /** - * A URI that identifies the problem type, pointing to human-readable documentation on this problem type. - * @return type - **/ - @ApiModelProperty(required = true, value = "A URI that identifies the problem type, pointing to human-readable documentation on this problem type.") - - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RestServiceError restServiceError = (RestServiceError) o; - return Objects.equals(this.detail, restServiceError.detail) && - Objects.equals(this.errorCode, restServiceError.errorCode) && - Objects.equals(this.instance, restServiceError.instance) && - Objects.equals(this.invalidFields, restServiceError.invalidFields) && - Objects.equals(this.requestId, restServiceError.requestId) && - Objects.equals(this.response, restServiceError.response) && - Objects.equals(this.status, restServiceError.status) && - Objects.equals(this.title, restServiceError.title) && - Objects.equals(this.type, restServiceError.type); - } - - @Override - public int hashCode() { - return Objects.hash(detail, errorCode, instance, invalidFields, requestId, response, status, title, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RestServiceError {\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(" response: ").append(toIndentedString(response)).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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("detail"); - openapiFields.add("errorCode"); - openapiFields.add("instance"); - openapiFields.add("invalidFields"); - openapiFields.add("requestId"); - openapiFields.add("response"); - openapiFields.add("status"); - openapiFields.add("title"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("detail"); - openapiRequiredFields.add("errorCode"); - openapiRequiredFields.add("status"); - openapiRequiredFields.add("title"); - openapiRequiredFields.add("type"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(RestServiceError.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to RestServiceError - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (RestServiceError.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in RestServiceError is not found in the empty JSON string", RestServiceError.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!RestServiceError.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RestServiceError` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RestServiceError.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field detail - if (jsonObj.get("detail") != null && !jsonObj.get("detail").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); - } - // validate the optional field errorCode - if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); - } - // validate the optional field instance - if (jsonObj.get("instance") != null && !jsonObj.get("instance").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `instance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instance").toString())); - } - JsonArray jsonArrayinvalidFields = jsonObj.getAsJsonArray("invalidFields"); - if (jsonArrayinvalidFields != null) { - // ensure the json data is an array - if (!jsonObj.get("invalidFields").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `invalidFields` to be an array in the JSON string but got `%s`", jsonObj.get("invalidFields").toString())); - } - - // validate the optional field `invalidFields` (array) - for (int i = 0; i < jsonArrayinvalidFields.size(); i++) { - InvalidField.validateJsonObject(jsonArrayinvalidFields.get(i).getAsJsonObject()); - } - } - // validate the optional field requestId - if (jsonObj.get("requestId") != null && !jsonObj.get("requestId").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString())); - } - // validate the optional field `response` - if (jsonObj.getAsJsonObject("response") != null) { - JSONObject.validateJsonObject(jsonObj.getAsJsonObject("response")); - } - // validate the optional field title - if (jsonObj.get("title") != null && !jsonObj.get("title").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); - } - // validate the optional field type - if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RestServiceError.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RestServiceError' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RestServiceError.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, RestServiceError value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RestServiceError read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of RestServiceError given an JSON string - * - * @param jsonString JSON string - * @return An instance of RestServiceError - * @throws IOException if the JSON string is invalid with respect to RestServiceError - */ - public static RestServiceError fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RestServiceError.class); - } - - /** - * Convert an instance of RestServiceError to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/capital/ThresholdRepayment.java b/src/main/java/com/adyen/model/capital/ThresholdRepayment.java deleted file mode 100644 index cd3f18e2e..000000000 --- a/src/main/java/com/adyen/model/capital/ThresholdRepayment.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Capital API - * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. - * - * The version of the OpenAPI document: 3 - * Contact: developer-experience@adyen.com - * - * 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 java.util.Objects; -import java.util.Arrays; -import com.adyen.model.capital.Amount; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import com.adyen.model.capital.JSON; - -/** - * ThresholdRepayment - */ - -public class ThresholdRepayment { - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private Amount amount; - - public ThresholdRepayment() { - } - - public ThresholdRepayment amount(Amount amount) { - - this.amount = amount; - return this; - } - - /** - * Get amount - * @return amount - **/ - @ApiModelProperty(required = true, value = "") - - public Amount getAmount() { - return amount; - } - - - public void setAmount(Amount amount) { - this.amount = amount; - } - - - - @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); - } - - @Override - public int hashCode() { - return Objects.hash(amount); - } - - @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 "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("amount"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("amount"); - } - /** - * logger for Deserialization Errors - */ - private static final Logger log = Logger.getLogger(ThresholdRepayment.class.getName()); - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to ThresholdRepayment - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ThresholdRepayment.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ThresholdRepayment is not found in the empty JSON string", ThresholdRepayment.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ThresholdRepayment.openapiFields.contains(entry.getKey())) { - log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThresholdRepayment` properties.", entry.getKey())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ThresholdRepayment.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field `amount` - if (jsonObj.getAsJsonObject("amount") != null) { - Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ThresholdRepayment.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ThresholdRepayment' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ThresholdRepayment.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ThresholdRepayment value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ThresholdRepayment read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ThresholdRepayment given an JSON string - * - * @param jsonString JSON string - * @return An instance of ThresholdRepayment - * @throws IOException if the JSON string is invalid with respect to ThresholdRepayment - */ - public static ThresholdRepayment fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ThresholdRepayment.class); - } - - /** - * Convert an instance of ThresholdRepayment to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - From c0e55c2124ec33aa0bf82f6d55c2c0a15276d581 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:40:23 +0200 Subject: [PATCH 2/6] Protected service URLs (#1101) * Lem v2 fix by extending HOP and changing url to v2 * make urls protected, regenerate and move service extension to extensions dir * remove extension class * remove import --- .../AcceptTermsOfServiceRequest.java | 4 ++-- .../legalentitymanagement/BusinessLineInfoUpdate.java | 2 +- .../com/adyen/model/legalentitymanagement/Document.java | 9 ++++++--- src/main/java/com/adyen/service/BalanceControlApi.java | 2 +- src/main/java/com/adyen/service/BinLookupApi.java | 2 +- src/main/java/com/adyen/service/DataProtectionApi.java | 2 +- src/main/java/com/adyen/service/PaymentApi.java | 2 +- .../java/com/adyen/service/PosTerminalManagementApi.java | 2 +- src/main/java/com/adyen/service/RecurringApi.java | 2 +- src/main/java/com/adyen/service/StoredValueApi.java | 2 +- .../adyen/service/balanceplatform/AccountHoldersApi.java | 2 +- .../service/balanceplatform/BalanceAccountsApi.java | 2 +- .../balanceplatform/BankAccountValidationApi.java | 2 +- .../adyen/service/balanceplatform/GrantAccountsApi.java | 2 +- .../adyen/service/balanceplatform/GrantOffersApi.java | 2 +- .../balanceplatform/PaymentInstrumentGroupsApi.java | 2 +- .../service/balanceplatform/PaymentInstrumentsApi.java | 2 +- .../com/adyen/service/balanceplatform/PlatformApi.java | 2 +- .../service/balanceplatform/TransactionRulesApi.java | 2 +- .../adyen/service/checkout/ClassicCheckoutSdkApi.java | 2 +- .../com/adyen/service/checkout/ModificationsApi.java | 2 +- src/main/java/com/adyen/service/checkout/OrdersApi.java | 2 +- .../java/com/adyen/service/checkout/PaymentLinksApi.java | 2 +- .../java/com/adyen/service/checkout/PaymentsApi.java | 2 +- .../java/com/adyen/service/checkout/RecurringApi.java | 2 +- src/main/java/com/adyen/service/checkout/UtilityApi.java | 2 +- .../service/legalentitymanagement/BusinessLinesApi.java | 2 +- .../service/legalentitymanagement/DocumentsApi.java | 2 +- .../legalentitymanagement/HostedOnboardingApi.java | 2 +- .../service/legalentitymanagement/LegalEntitiesApi.java | 2 +- .../legalentitymanagement/PciQuestionnairesApi.java | 2 +- .../service/legalentitymanagement/TermsOfServiceApi.java | 2 +- .../legalentitymanagement/TransferInstrumentsApi.java | 2 +- .../adyen/service/management/AccountCompanyLevelApi.java | 2 +- .../service/management/AccountMerchantLevelApi.java | 2 +- .../adyen/service/management/AccountStoreLevelApi.java | 2 +- .../management/AllowedOriginsCompanyLevelApi.java | 2 +- .../management/AllowedOriginsMerchantLevelApi.java | 2 +- .../management/ApiCredentialsCompanyLevelApi.java | 2 +- .../management/ApiCredentialsMerchantLevelApi.java | 2 +- .../adyen/service/management/ApiKeyCompanyLevelApi.java | 2 +- .../adyen/service/management/ApiKeyMerchantLevelApi.java | 2 +- .../service/management/ClientKeyCompanyLevelApi.java | 2 +- .../service/management/ClientKeyMerchantLevelApi.java | 2 +- .../com/adyen/service/management/MyApiCredentialApi.java | 2 +- .../management/PaymentMethodsMerchantLevelApi.java | 2 +- .../management/PayoutSettingsMerchantLevelApi.java | 2 +- .../management/SplitConfigurationMerchantLevelApi.java | 2 +- .../management/TerminalActionsCompanyLevelApi.java | 2 +- .../management/TerminalActionsTerminalLevelApi.java | 2 +- .../management/TerminalOrdersCompanyLevelApi.java | 2 +- .../management/TerminalOrdersMerchantLevelApi.java | 2 +- .../management/TerminalSettingsCompanyLevelApi.java | 2 +- .../management/TerminalSettingsMerchantLevelApi.java | 2 +- .../management/TerminalSettingsStoreLevelApi.java | 2 +- .../management/TerminalSettingsTerminalLevelApi.java | 2 +- .../service/management/TerminalsTerminalLevelApi.java | 2 +- .../adyen/service/management/UsersCompanyLevelApi.java | 2 +- .../adyen/service/management/UsersMerchantLevelApi.java | 2 +- .../service/management/WebhooksCompanyLevelApi.java | 2 +- .../service/management/WebhooksMerchantLevelApi.java | 2 +- .../java/com/adyen/service/payout/InitializationApi.java | 2 +- .../java/com/adyen/service/payout/InstantPayoutsApi.java | 2 +- src/main/java/com/adyen/service/payout/ReviewingApi.java | 2 +- .../java/com/adyen/service/transfers/CapitalApi.java | 2 +- .../com/adyen/service/transfers/TransactionsApi.java | 2 +- .../java/com/adyen/service/transfers/TransfersApi.java | 2 +- src/test/java/com/adyen/LegalEntityManagementTest.java | 3 --- templates/libraries/jersey3/api.mustache | 2 +- templates/libraries/jersey3/api_single.mustache | 2 +- 70 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java index 672e48eac..70cb1a82a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java @@ -51,10 +51,10 @@ public AcceptTermsOfServiceRequest acceptedBy(String acceptedBy) { } /** - * The unique identifier of the user accepting the Terms of Service. + * The individual legal entity ID of the user accepting the Terms of Service. This can also be the legal entity ID of the signatory for an organization. * @return acceptedBy **/ - @ApiModelProperty(required = true, value = "The unique identifier of the user accepting the Terms of Service.") + @ApiModelProperty(required = true, value = "The individual legal entity ID of the user accepting the Terms of Service. This can also be the legal entity ID of the signatory for an organization.") @JsonProperty(JSON_PROPERTY_ACCEPTED_BY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java index 67c2e7848..dadfcc82c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java @@ -268,7 +268,7 @@ public BusinessLineInfoUpdate service(ServiceEnum service) { * The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** * @return service **/ - @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking**") + @ApiModelProperty(value = "The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking**") @JsonProperty(JSON_PROPERTY_SERVICE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Document.java b/src/main/java/com/adyen/model/legalentitymanagement/Document.java index 2e773107d..159ad6e64 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Document.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Document.java @@ -56,7 +56,7 @@ public class Document { private Attachment attachment; public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments = new ArrayList<>(); + private List attachments = null; public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; @@ -184,6 +184,9 @@ public Document attachments(List attachments) { } public Document addAttachmentsItem(Attachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } this.attachments.add(attachmentsItem); return this; } @@ -192,7 +195,7 @@ public Document addAttachmentsItem(Attachment attachmentsItem) { * Array that contains the document. The array supports multiple attachments for uploading different sides or pages of a document. * @return attachments **/ - @ApiModelProperty(required = true, value = "Array that contains the document. The array supports multiple attachments for uploading different sides or pages of a document.") + @ApiModelProperty(value = "Array that contains the document. The array supports multiple attachments for uploading different sides or pages of a document.") @JsonProperty(JSON_PROPERTY_ATTACHMENTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -451,7 +454,7 @@ public Document owner(OwnerEntity owner) { * Get owner * @return owner **/ - @ApiModelProperty(required = true, value = "") + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OWNER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/service/BalanceControlApi.java b/src/main/java/com/adyen/service/BalanceControlApi.java index ce799e348..6b3b8c1ec 100644 --- a/src/main/java/com/adyen/service/BalanceControlApi.java +++ b/src/main/java/com/adyen/service/BalanceControlApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class BalanceControlApi extends Service { - private final String baseURL; + protected String baseURL; public BalanceControlApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/BinLookupApi.java b/src/main/java/com/adyen/service/BinLookupApi.java index 12eac1717..fd3eb487f 100644 --- a/src/main/java/com/adyen/service/BinLookupApi.java +++ b/src/main/java/com/adyen/service/BinLookupApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class BinLookupApi extends Service { - private final String baseURL; + protected String baseURL; public BinLookupApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/DataProtectionApi.java b/src/main/java/com/adyen/service/DataProtectionApi.java index 87e663c3f..1a6544f0a 100644 --- a/src/main/java/com/adyen/service/DataProtectionApi.java +++ b/src/main/java/com/adyen/service/DataProtectionApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class DataProtectionApi extends Service { - private final String baseURL; + protected String baseURL; public DataProtectionApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/PaymentApi.java b/src/main/java/com/adyen/service/PaymentApi.java index 461f33695..25d45ab67 100644 --- a/src/main/java/com/adyen/service/PaymentApi.java +++ b/src/main/java/com/adyen/service/PaymentApi.java @@ -42,7 +42,7 @@ import java.util.Map; public class PaymentApi extends Service { - private final String baseURL; + protected String baseURL; public PaymentApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/PosTerminalManagementApi.java b/src/main/java/com/adyen/service/PosTerminalManagementApi.java index a8890e7dc..a96e7d811 100644 --- a/src/main/java/com/adyen/service/PosTerminalManagementApi.java +++ b/src/main/java/com/adyen/service/PosTerminalManagementApi.java @@ -35,7 +35,7 @@ import java.util.Map; public class PosTerminalManagementApi extends Service { - private final String baseURL; + protected String baseURL; public PosTerminalManagementApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/RecurringApi.java b/src/main/java/com/adyen/service/RecurringApi.java index db4934b9f..ba08bd5bd 100644 --- a/src/main/java/com/adyen/service/RecurringApi.java +++ b/src/main/java/com/adyen/service/RecurringApi.java @@ -37,7 +37,7 @@ import java.util.Map; public class RecurringApi extends Service { - private final String baseURL; + protected String baseURL; public RecurringApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/StoredValueApi.java b/src/main/java/com/adyen/service/StoredValueApi.java index 893a6752f..ac7208841 100644 --- a/src/main/java/com/adyen/service/StoredValueApi.java +++ b/src/main/java/com/adyen/service/StoredValueApi.java @@ -37,7 +37,7 @@ import java.util.Map; public class StoredValueApi extends Service { - private final String baseURL; + protected String baseURL; public StoredValueApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java b/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java index 33402c104..588af92ff 100644 --- a/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class AccountHoldersApi extends Service { - private final String baseURL; + protected String baseURL; public AccountHoldersApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java b/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java index 82c1ef2db..1ed676eac 100644 --- a/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java @@ -30,7 +30,7 @@ import java.util.Map; public class BalanceAccountsApi extends Service { - private final String baseURL; + protected String baseURL; public BalanceAccountsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java index 164fd9de1..2037f4184 100644 --- a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class BankAccountValidationApi extends Service { - private final String baseURL; + protected String baseURL; public BankAccountValidationApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/GrantAccountsApi.java b/src/main/java/com/adyen/service/balanceplatform/GrantAccountsApi.java index 6b197c122..e345de7e5 100644 --- a/src/main/java/com/adyen/service/balanceplatform/GrantAccountsApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/GrantAccountsApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class GrantAccountsApi extends Service { - private final String baseURL; + protected String baseURL; public GrantAccountsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/GrantOffersApi.java b/src/main/java/com/adyen/service/balanceplatform/GrantOffersApi.java index 61753c42e..aa24a9b1f 100644 --- a/src/main/java/com/adyen/service/balanceplatform/GrantOffersApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/GrantOffersApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class GrantOffersApi extends Service { - private final String baseURL; + protected String baseURL; public GrantOffersApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java index a195e4fdc..f4ec702fb 100644 --- a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class PaymentInstrumentGroupsApi extends Service { - private final String baseURL; + protected String baseURL; public PaymentInstrumentGroupsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java index b05b7358f..0f72d0504 100644 --- a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java @@ -30,7 +30,7 @@ import java.util.Map; public class PaymentInstrumentsApi extends Service { - private final String baseURL; + protected String baseURL; public PaymentInstrumentsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/PlatformApi.java b/src/main/java/com/adyen/service/balanceplatform/PlatformApi.java index 328d8cec9..eb90a48e8 100644 --- a/src/main/java/com/adyen/service/balanceplatform/PlatformApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/PlatformApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class PlatformApi extends Service { - private final String baseURL; + protected String baseURL; public PlatformApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/balanceplatform/TransactionRulesApi.java b/src/main/java/com/adyen/service/balanceplatform/TransactionRulesApi.java index efb137921..80d9f2481 100644 --- a/src/main/java/com/adyen/service/balanceplatform/TransactionRulesApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/TransactionRulesApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class TransactionRulesApi extends Service { - private final String baseURL; + protected String baseURL; public TransactionRulesApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/checkout/ClassicCheckoutSdkApi.java b/src/main/java/com/adyen/service/checkout/ClassicCheckoutSdkApi.java index 1d38403d0..df69f2102 100644 --- a/src/main/java/com/adyen/service/checkout/ClassicCheckoutSdkApi.java +++ b/src/main/java/com/adyen/service/checkout/ClassicCheckoutSdkApi.java @@ -28,7 +28,7 @@ import java.util.Map; public class ClassicCheckoutSdkApi extends Service { - private final String baseURL; + protected String baseURL; public ClassicCheckoutSdkApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/checkout/ModificationsApi.java b/src/main/java/com/adyen/service/checkout/ModificationsApi.java index 0058c8256..3c5fcca4f 100644 --- a/src/main/java/com/adyen/service/checkout/ModificationsApi.java +++ b/src/main/java/com/adyen/service/checkout/ModificationsApi.java @@ -36,7 +36,7 @@ import java.util.Map; public class ModificationsApi extends Service { - private final String baseURL; + protected String baseURL; public ModificationsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/checkout/OrdersApi.java b/src/main/java/com/adyen/service/checkout/OrdersApi.java index d4461309b..b4eb995f4 100644 --- a/src/main/java/com/adyen/service/checkout/OrdersApi.java +++ b/src/main/java/com/adyen/service/checkout/OrdersApi.java @@ -30,7 +30,7 @@ import java.util.Map; public class OrdersApi extends Service { - private final String baseURL; + protected String baseURL; public OrdersApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/checkout/PaymentLinksApi.java b/src/main/java/com/adyen/service/checkout/PaymentLinksApi.java index f4b9aa8f0..0b20585b6 100644 --- a/src/main/java/com/adyen/service/checkout/PaymentLinksApi.java +++ b/src/main/java/com/adyen/service/checkout/PaymentLinksApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class PaymentLinksApi extends Service { - private final String baseURL; + protected String baseURL; public PaymentLinksApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/checkout/PaymentsApi.java b/src/main/java/com/adyen/service/checkout/PaymentsApi.java index 012798804..4d2db2440 100644 --- a/src/main/java/com/adyen/service/checkout/PaymentsApi.java +++ b/src/main/java/com/adyen/service/checkout/PaymentsApi.java @@ -37,7 +37,7 @@ import java.util.Map; public class PaymentsApi extends Service { - private final String baseURL; + protected String baseURL; public PaymentsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/checkout/RecurringApi.java b/src/main/java/com/adyen/service/checkout/RecurringApi.java index 6466570e9..d2c919e14 100644 --- a/src/main/java/com/adyen/service/checkout/RecurringApi.java +++ b/src/main/java/com/adyen/service/checkout/RecurringApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class RecurringApi extends Service { - private final String baseURL; + protected String baseURL; public RecurringApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/checkout/UtilityApi.java b/src/main/java/com/adyen/service/checkout/UtilityApi.java index 0050aba5b..8f00e7db2 100644 --- a/src/main/java/com/adyen/service/checkout/UtilityApi.java +++ b/src/main/java/com/adyen/service/checkout/UtilityApi.java @@ -28,7 +28,7 @@ import java.util.Map; public class UtilityApi extends Service { - private final String baseURL; + protected String baseURL; public UtilityApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java index a282780c2..b023b5a15 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class BusinessLinesApi extends Service { - private final String baseURL; + protected String baseURL; public BusinessLinesApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java b/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java index c44ab79b1..b7c19fdd8 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class DocumentsApi extends Service { - private final String baseURL; + protected String baseURL; public DocumentsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java index 8f688e25c..82f33d5de 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java @@ -28,7 +28,7 @@ import java.util.Map; public class HostedOnboardingApi extends Service { - private final String baseURL; + protected String baseURL; public HostedOnboardingApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java index 47e9f3414..c863c69c5 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class LegalEntitiesApi extends Service { - private final String baseURL; + protected String baseURL; public LegalEntitiesApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java index 4a15f5c80..315a250e9 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java @@ -30,7 +30,7 @@ import java.util.Map; public class PciQuestionnairesApi extends Service { - private final String baseURL; + protected String baseURL; public PciQuestionnairesApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java b/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java index 83030a55e..65af5f5c6 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java @@ -30,7 +30,7 @@ import java.util.Map; public class TermsOfServiceApi extends Service { - private final String baseURL; + protected String baseURL; public TermsOfServiceApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java index f37567dbb..2c33f16e1 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class TransferInstrumentsApi extends Service { - private final String baseURL; + protected String baseURL; public TransferInstrumentsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/AccountCompanyLevelApi.java b/src/main/java/com/adyen/service/management/AccountCompanyLevelApi.java index 541638664..03b864518 100644 --- a/src/main/java/com/adyen/service/management/AccountCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/AccountCompanyLevelApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class AccountCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public AccountCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/AccountMerchantLevelApi.java b/src/main/java/com/adyen/service/management/AccountMerchantLevelApi.java index d8ae62f7c..f3b8d903c 100644 --- a/src/main/java/com/adyen/service/management/AccountMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/AccountMerchantLevelApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class AccountMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public AccountMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/AccountStoreLevelApi.java b/src/main/java/com/adyen/service/management/AccountStoreLevelApi.java index c35407f67..c7eafaabf 100644 --- a/src/main/java/com/adyen/service/management/AccountStoreLevelApi.java +++ b/src/main/java/com/adyen/service/management/AccountStoreLevelApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class AccountStoreLevelApi extends Service { - private final String baseURL; + protected String baseURL; public AccountStoreLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevelApi.java b/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevelApi.java index c0efab22b..51c27769c 100644 --- a/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevelApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class AllowedOriginsCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public AllowedOriginsCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevelApi.java index cb075fd12..ebb747fcf 100644 --- a/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevelApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class AllowedOriginsMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public AllowedOriginsMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevelApi.java b/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevelApi.java index 3c4af3a0e..825bc4324 100644 --- a/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevelApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class ApiCredentialsCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public ApiCredentialsCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevelApi.java index b14b176df..1d6ab49a8 100644 --- a/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevelApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class ApiCredentialsMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public ApiCredentialsMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/ApiKeyCompanyLevelApi.java b/src/main/java/com/adyen/service/management/ApiKeyCompanyLevelApi.java index 6fc008cd7..68e3a473e 100644 --- a/src/main/java/com/adyen/service/management/ApiKeyCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/ApiKeyCompanyLevelApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class ApiKeyCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public ApiKeyCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/ApiKeyMerchantLevelApi.java b/src/main/java/com/adyen/service/management/ApiKeyMerchantLevelApi.java index a9dad74b9..4fad59c5d 100644 --- a/src/main/java/com/adyen/service/management/ApiKeyMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/ApiKeyMerchantLevelApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class ApiKeyMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public ApiKeyMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/ClientKeyCompanyLevelApi.java b/src/main/java/com/adyen/service/management/ClientKeyCompanyLevelApi.java index b3996fbf3..e2043fa5b 100644 --- a/src/main/java/com/adyen/service/management/ClientKeyCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/ClientKeyCompanyLevelApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class ClientKeyCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public ClientKeyCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/ClientKeyMerchantLevelApi.java b/src/main/java/com/adyen/service/management/ClientKeyMerchantLevelApi.java index e541365b7..f7ac10e80 100644 --- a/src/main/java/com/adyen/service/management/ClientKeyMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/ClientKeyMerchantLevelApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class ClientKeyMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public ClientKeyMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/MyApiCredentialApi.java b/src/main/java/com/adyen/service/management/MyApiCredentialApi.java index 0d0e736ae..167c06693 100644 --- a/src/main/java/com/adyen/service/management/MyApiCredentialApi.java +++ b/src/main/java/com/adyen/service/management/MyApiCredentialApi.java @@ -28,7 +28,7 @@ import java.util.Map; public class MyApiCredentialApi extends Service { - private final String baseURL; + protected String baseURL; public MyApiCredentialApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevelApi.java index acf9a4bc6..804a0bc4a 100644 --- a/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevelApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class PaymentMethodsMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public PaymentMethodsMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevelApi.java index 2e79f46e8..0b1ebc526 100644 --- a/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevelApi.java @@ -28,7 +28,7 @@ import java.util.Map; public class PayoutSettingsMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public PayoutSettingsMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/SplitConfigurationMerchantLevelApi.java b/src/main/java/com/adyen/service/management/SplitConfigurationMerchantLevelApi.java index 427d6c7fe..4d2b6736f 100644 --- a/src/main/java/com/adyen/service/management/SplitConfigurationMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/SplitConfigurationMerchantLevelApi.java @@ -30,7 +30,7 @@ import java.util.Map; public class SplitConfigurationMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public SplitConfigurationMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevelApi.java b/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevelApi.java index 86ed0e66e..63e32706e 100644 --- a/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevelApi.java @@ -28,7 +28,7 @@ import java.util.Map; public class TerminalActionsCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalActionsCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevelApi.java b/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevelApi.java index f911ad5f2..4413d544a 100644 --- a/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevelApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class TerminalActionsTerminalLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalActionsTerminalLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevelApi.java b/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevelApi.java index 3916a3255..24e483509 100644 --- a/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevelApi.java @@ -32,7 +32,7 @@ import java.util.Map; public class TerminalOrdersCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalOrdersCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevelApi.java b/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevelApi.java index 5fc60ba9c..f923fc71d 100644 --- a/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevelApi.java @@ -32,7 +32,7 @@ import java.util.Map; public class TerminalOrdersMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalOrdersMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevelApi.java b/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevelApi.java index 20adac104..ff715d083 100644 --- a/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevelApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class TerminalSettingsCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalSettingsCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevelApi.java index 4e1118111..7156385ef 100644 --- a/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevelApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class TerminalSettingsMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalSettingsMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevelApi.java b/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevelApi.java index 3683e449b..009fe67c8 100644 --- a/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevelApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class TerminalSettingsStoreLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalSettingsStoreLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevelApi.java b/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevelApi.java index 1b4e10318..e320c69c2 100644 --- a/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevelApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class TerminalSettingsTerminalLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalSettingsTerminalLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/TerminalsTerminalLevelApi.java b/src/main/java/com/adyen/service/management/TerminalsTerminalLevelApi.java index 238aa800e..9928660cf 100644 --- a/src/main/java/com/adyen/service/management/TerminalsTerminalLevelApi.java +++ b/src/main/java/com/adyen/service/management/TerminalsTerminalLevelApi.java @@ -25,7 +25,7 @@ import java.util.Map; public class TerminalsTerminalLevelApi extends Service { - private final String baseURL; + protected String baseURL; public TerminalsTerminalLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/UsersCompanyLevelApi.java b/src/main/java/com/adyen/service/management/UsersCompanyLevelApi.java index c3d7ff99b..e188c5d81 100644 --- a/src/main/java/com/adyen/service/management/UsersCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/UsersCompanyLevelApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class UsersCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public UsersCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/UsersMerchantLevelApi.java b/src/main/java/com/adyen/service/management/UsersMerchantLevelApi.java index f59cd7ed7..5ddccdf2c 100644 --- a/src/main/java/com/adyen/service/management/UsersMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/UsersMerchantLevelApi.java @@ -29,7 +29,7 @@ import java.util.Map; public class UsersMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public UsersMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/WebhooksCompanyLevelApi.java b/src/main/java/com/adyen/service/management/WebhooksCompanyLevelApi.java index 72d3c2c6c..0812cfb1a 100644 --- a/src/main/java/com/adyen/service/management/WebhooksCompanyLevelApi.java +++ b/src/main/java/com/adyen/service/management/WebhooksCompanyLevelApi.java @@ -31,7 +31,7 @@ import java.util.Map; public class WebhooksCompanyLevelApi extends Service { - private final String baseURL; + protected String baseURL; public WebhooksCompanyLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/management/WebhooksMerchantLevelApi.java b/src/main/java/com/adyen/service/management/WebhooksMerchantLevelApi.java index a29cac5e9..fd635823b 100644 --- a/src/main/java/com/adyen/service/management/WebhooksMerchantLevelApi.java +++ b/src/main/java/com/adyen/service/management/WebhooksMerchantLevelApi.java @@ -31,7 +31,7 @@ import java.util.Map; public class WebhooksMerchantLevelApi extends Service { - private final String baseURL; + protected String baseURL; public WebhooksMerchantLevelApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/payout/InitializationApi.java b/src/main/java/com/adyen/service/payout/InitializationApi.java index 83f1f04b0..451ce1c48 100644 --- a/src/main/java/com/adyen/service/payout/InitializationApi.java +++ b/src/main/java/com/adyen/service/payout/InitializationApi.java @@ -30,7 +30,7 @@ import java.util.Map; public class InitializationApi extends Service { - private final String baseURL; + protected String baseURL; public InitializationApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/payout/InstantPayoutsApi.java b/src/main/java/com/adyen/service/payout/InstantPayoutsApi.java index 890a7fe31..366dcf40d 100644 --- a/src/main/java/com/adyen/service/payout/InstantPayoutsApi.java +++ b/src/main/java/com/adyen/service/payout/InstantPayoutsApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class InstantPayoutsApi extends Service { - private final String baseURL; + protected String baseURL; public InstantPayoutsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/payout/ReviewingApi.java b/src/main/java/com/adyen/service/payout/ReviewingApi.java index 58e171368..7b3a8d29e 100644 --- a/src/main/java/com/adyen/service/payout/ReviewingApi.java +++ b/src/main/java/com/adyen/service/payout/ReviewingApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class ReviewingApi extends Service { - private final String baseURL; + protected String baseURL; public ReviewingApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/transfers/CapitalApi.java b/src/main/java/com/adyen/service/transfers/CapitalApi.java index c3d1ee99c..11fa48b70 100644 --- a/src/main/java/com/adyen/service/transfers/CapitalApi.java +++ b/src/main/java/com/adyen/service/transfers/CapitalApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class CapitalApi extends Service { - private final String baseURL; + protected String baseURL; public CapitalApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/transfers/TransactionsApi.java b/src/main/java/com/adyen/service/transfers/TransactionsApi.java index a1da61fc2..6b4fd99da 100644 --- a/src/main/java/com/adyen/service/transfers/TransactionsApi.java +++ b/src/main/java/com/adyen/service/transfers/TransactionsApi.java @@ -27,7 +27,7 @@ import java.util.Map; public class TransactionsApi extends Service { - private final String baseURL; + protected String baseURL; public TransactionsApi(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/transfers/TransfersApi.java b/src/main/java/com/adyen/service/transfers/TransfersApi.java index 72fd4be54..56e72af01 100644 --- a/src/main/java/com/adyen/service/transfers/TransfersApi.java +++ b/src/main/java/com/adyen/service/transfers/TransfersApi.java @@ -26,7 +26,7 @@ import java.util.Map; public class TransfersApi extends Service { - private final String baseURL; + protected String baseURL; public TransfersApi(Client client) { super(client); diff --git a/src/test/java/com/adyen/LegalEntityManagementTest.java b/src/test/java/com/adyen/LegalEntityManagementTest.java index b448b64d2..c3fee5493 100644 --- a/src/test/java/com/adyen/LegalEntityManagementTest.java +++ b/src/test/java/com/adyen/LegalEntityManagementTest.java @@ -1,9 +1,7 @@ package com.adyen; import com.adyen.constants.ApiConstants; -import com.adyen.model.checkout.CheckoutAwaitAction; import com.adyen.model.legalentitymanagement.*; -import com.adyen.model.recurring.BankAccount; import com.adyen.service.legalentitymanagement.*; import org.junit.Assert; import org.junit.Test; @@ -13,7 +11,6 @@ import java.util.logging.Logger; import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.verify; public class LegalEntityManagementTest extends BaseTest { diff --git a/templates/libraries/jersey3/api.mustache b/templates/libraries/jersey3/api.mustache index 14006d2cd..41cdbe24e 100644 --- a/templates/libraries/jersey3/api.mustache +++ b/templates/libraries/jersey3/api.mustache @@ -16,7 +16,7 @@ import java.util.Map; {{#operations}} public class {{classname}} extends Service { - private final String baseURL; + protected String baseURL; public {{classname}}(Client client) { super(client); diff --git a/templates/libraries/jersey3/api_single.mustache b/templates/libraries/jersey3/api_single.mustache index 730154d4b..2cc1bab6e 100644 --- a/templates/libraries/jersey3/api_single.mustache +++ b/templates/libraries/jersey3/api_single.mustache @@ -16,7 +16,7 @@ import java.util.Map; {{#operations}} public class {{smallServiceName}} extends Service { - private final String baseURL; + protected String baseURL; public {{smallServiceName}}(Client client) { super(client); From c9d20acbe286c67937216ccc8cc79674a3103611 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:41:51 +0200 Subject: [PATCH 3/6] Fix unit tests for the automation (#1104) * [create-pull-request] automated change * fix unit tests --------- Co-authored-by: Adyen Automation --- .../model/balanceplatform/AccountHolder.java | 37 +- .../balanceplatform/AccountHolderInfo.java | 37 +- .../AccountHolderUpdateRequest.java | 508 ++++++++++++ .../BRLocalAccountIdentification.java | 254 ++++++ .../adyen/model/balanceplatform/Balance.java | 33 +- .../model/balanceplatform/BalanceAccount.java | 69 +- .../balanceplatform/BalanceAccountBase.java | 69 +- .../balanceplatform/BalanceAccountInfo.java | 69 +- .../BalanceAccountUpdateRequest.java | 38 +- ...alidationRequestAccountIdentification.java | 216 ++++- .../com/adyen/model/balanceplatform/Card.java | 41 +- .../adyen/model/balanceplatform/CardInfo.java | 41 +- .../balanceplatform/CronSweepSchedule.java | 200 ----- .../DKLocalAccountIdentification.java | 223 +++++ .../model/balanceplatform/DeviceInfo.java | 448 ++++++++++ .../GetNetworkTokenResponse.java | 129 +++ .../HKLocalAccountIdentification.java | 223 +++++ .../ListNetworkTokensResponse.java | 139 ++++ .../NZLocalAccountIdentification.java | 254 ++++++ .../model/balanceplatform/NetworkToken.java | 386 +++++++++ .../PlatformPaymentConfiguration.java | 159 ++++ .../balanceplatform/SweepConfigurationV2.java | 10 +- .../SweepConfigurationV2Schedule.java | 266 ------ .../model/balanceplatform/SweepSchedule.java | 41 +- .../balanceplatform/TransactionRule.java | 2 + .../balanceplatform/TransactionRuleInfo.java | 2 + .../UpdateNetworkTokenRequest.java | 165 ++++ .../UpdateSweepConfigurationV2.java | 784 ++++++++++++++++++ .../balanceplatform/AccountHoldersApi.java | 13 +- .../balanceplatform/BalanceAccountsApi.java | 13 +- .../BankAccountValidationApi.java | 2 +- .../balanceplatform/NetworkTokensApi.java | 100 +++ .../PaymentInstrumentsApi.java | 34 + .../java/com/adyen/BalancePlatformTest.java | 42 +- 34 files changed, 4494 insertions(+), 553 deletions(-) create mode 100644 src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java delete mode 100644 src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/NetworkToken.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java delete mode 100644 src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/NetworkTokensApi.java diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index c39ce044e..b3ab69e21 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -45,6 +45,7 @@ AccountHolder.JSON_PROPERTY_ID, AccountHolder.JSON_PROPERTY_LEGAL_ENTITY_ID, AccountHolder.JSON_PROPERTY_METADATA, + AccountHolder.JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, AccountHolder.JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT, AccountHolder.JSON_PROPERTY_REFERENCE, AccountHolder.JSON_PROPERTY_STATUS, @@ -74,6 +75,9 @@ public class AccountHolder { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata = null; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; + private String migratedAccountHolderCode; + public static final String JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; private String primaryBalanceAccount; @@ -303,10 +307,10 @@ public AccountHolder putMetadataItem(String key, String metadataItem) { } /** - * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * @return metadata **/ - @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + @ApiModelProperty(value = "A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -322,6 +326,31 @@ public void setMetadata(Map metadata) { } + public AccountHolder migratedAccountHolderCode(String migratedAccountHolderCode) { + this.migratedAccountHolderCode = migratedAccountHolderCode; + return this; + } + + /** + * The unique identifier of the migrated account holder in the classic integration. + * @return migratedAccountHolderCode + **/ + @ApiModelProperty(value = "The unique identifier of the migrated account holder in the classic integration.") + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMigratedAccountHolderCode() { + return migratedAccountHolderCode; + } + + + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMigratedAccountHolderCode(String migratedAccountHolderCode) { + this.migratedAccountHolderCode = migratedAccountHolderCode; + } + + public AccountHolder primaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; return this; @@ -474,6 +503,7 @@ public boolean equals(Object o) { Objects.equals(this.id, accountHolder.id) && Objects.equals(this.legalEntityId, accountHolder.legalEntityId) && Objects.equals(this.metadata, accountHolder.metadata) && + Objects.equals(this.migratedAccountHolderCode, accountHolder.migratedAccountHolderCode) && Objects.equals(this.primaryBalanceAccount, accountHolder.primaryBalanceAccount) && Objects.equals(this.reference, accountHolder.reference) && Objects.equals(this.status, accountHolder.status) && @@ -483,7 +513,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(balancePlatform, capabilities, contactDetails, description, id, legalEntityId, metadata, primaryBalanceAccount, reference, status, timeZone, verificationDeadlines); + return Objects.hash(balancePlatform, capabilities, contactDetails, description, id, legalEntityId, metadata, migratedAccountHolderCode, primaryBalanceAccount, reference, status, timeZone, verificationDeadlines); } @Override @@ -497,6 +527,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" migratedAccountHolderCode: ").append(toIndentedString(migratedAccountHolderCode)).append("\n"); sb.append(" primaryBalanceAccount: ").append(toIndentedString(primaryBalanceAccount)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java index ecca9bf5d..e26796af7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java @@ -42,6 +42,7 @@ AccountHolderInfo.JSON_PROPERTY_DESCRIPTION, AccountHolderInfo.JSON_PROPERTY_LEGAL_ENTITY_ID, AccountHolderInfo.JSON_PROPERTY_METADATA, + AccountHolderInfo.JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, AccountHolderInfo.JSON_PROPERTY_REFERENCE, AccountHolderInfo.JSON_PROPERTY_TIME_ZONE }) @@ -65,6 +66,9 @@ public class AccountHolderInfo { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata = null; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; + private String migratedAccountHolderCode; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; @@ -221,10 +225,10 @@ public AccountHolderInfo putMetadataItem(String key, String metadataItem) { } /** - * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * @return metadata **/ - @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + @ApiModelProperty(value = "A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -240,6 +244,31 @@ public void setMetadata(Map metadata) { } + public AccountHolderInfo migratedAccountHolderCode(String migratedAccountHolderCode) { + this.migratedAccountHolderCode = migratedAccountHolderCode; + return this; + } + + /** + * The unique identifier of the migrated account holder in the classic integration. + * @return migratedAccountHolderCode + **/ + @ApiModelProperty(value = "The unique identifier of the migrated account holder in the classic integration.") + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMigratedAccountHolderCode() { + return migratedAccountHolderCode; + } + + + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMigratedAccountHolderCode(String migratedAccountHolderCode) { + this.migratedAccountHolderCode = migratedAccountHolderCode; + } + + public AccountHolderInfo reference(String reference) { this.reference = reference; return this; @@ -308,13 +337,14 @@ public boolean equals(Object o) { Objects.equals(this.description, accountHolderInfo.description) && Objects.equals(this.legalEntityId, accountHolderInfo.legalEntityId) && Objects.equals(this.metadata, accountHolderInfo.metadata) && + Objects.equals(this.migratedAccountHolderCode, accountHolderInfo.migratedAccountHolderCode) && Objects.equals(this.reference, accountHolderInfo.reference) && Objects.equals(this.timeZone, accountHolderInfo.timeZone); } @Override public int hashCode() { - return Objects.hash(balancePlatform, capabilities, contactDetails, description, legalEntityId, metadata, reference, timeZone); + return Objects.hash(balancePlatform, capabilities, contactDetails, description, legalEntityId, metadata, migratedAccountHolderCode, reference, timeZone); } @Override @@ -327,6 +357,7 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" migratedAccountHolderCode: ").append(toIndentedString(migratedAccountHolderCode)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); sb.append("}"); diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java new file mode 100644 index 000000000..2f564d3b4 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java @@ -0,0 +1,508 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.adyen.model.balanceplatform.AccountHolderCapability; +import com.adyen.model.balanceplatform.ContactDetails; +import com.adyen.model.balanceplatform.VerificationDeadline; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * AccountHolderUpdateRequest + */ +@JsonPropertyOrder({ + AccountHolderUpdateRequest.JSON_PROPERTY_BALANCE_PLATFORM, + AccountHolderUpdateRequest.JSON_PROPERTY_CAPABILITIES, + AccountHolderUpdateRequest.JSON_PROPERTY_CONTACT_DETAILS, + AccountHolderUpdateRequest.JSON_PROPERTY_DESCRIPTION, + AccountHolderUpdateRequest.JSON_PROPERTY_METADATA, + AccountHolderUpdateRequest.JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, + AccountHolderUpdateRequest.JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT, + AccountHolderUpdateRequest.JSON_PROPERTY_REFERENCE, + AccountHolderUpdateRequest.JSON_PROPERTY_STATUS, + AccountHolderUpdateRequest.JSON_PROPERTY_TIME_ZONE, + AccountHolderUpdateRequest.JSON_PROPERTY_VERIFICATION_DEADLINES +}) + +public class AccountHolderUpdateRequest { + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; + private String balancePlatform; + + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; + private Map capabilities = null; + + public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; + private ContactDetails contactDetails; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; + + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; + private String migratedAccountHolderCode; + + public static final String JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; + private String primaryBalanceAccount; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + /** + * The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. + */ + public enum StatusEnum { + ACTIVE("active"), + + CLOSED("closed"), + + INACTIVE("inactive"), + + SUSPENDED("suspended"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; + private String timeZone; + + public static final String JSON_PROPERTY_VERIFICATION_DEADLINES = "verificationDeadlines"; + private List verificationDeadlines = null; + + public AccountHolderUpdateRequest() { + } + + public AccountHolderUpdateRequest balancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms.") + @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBalancePlatform() { + return balancePlatform; + } + + + @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public AccountHolderUpdateRequest capabilities(Map capabilities) { + this.capabilities = capabilities; + return this; + } + + public AccountHolderUpdateRequest putCapabilitiesItem(String key, AccountHolderCapability capabilitiesItem) { + if (this.capabilities == null) { + this.capabilities = new HashMap<>(); + } + this.capabilities.put(key, capabilitiesItem); + return this; + } + + /** + * Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + * @return capabilities + **/ + @ApiModelProperty(value = "Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability.") + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getCapabilities() { + return capabilities; + } + + + @JsonProperty(JSON_PROPERTY_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapabilities(Map capabilities) { + this.capabilities = capabilities; + } + + + public AccountHolderUpdateRequest contactDetails(ContactDetails contactDetails) { + this.contactDetails = contactDetails; + return this; + } + + /** + * Get contactDetails + * @return contactDetails + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CONTACT_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ContactDetails getContactDetails() { + return contactDetails; + } + + + @JsonProperty(JSON_PROPERTY_CONTACT_DETAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContactDetails(ContactDetails contactDetails) { + this.contactDetails = contactDetails; + } + + + public AccountHolderUpdateRequest description(String description) { + this.description = description; + return this; + } + + /** + * Your description for the account holder, maximum 300 characters. + * @return description + **/ + @ApiModelProperty(value = "Your description for the account holder, maximum 300 characters.") + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + + public AccountHolderUpdateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public AccountHolderUpdateRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @return metadata + **/ + @ApiModelProperty(value = "A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMetadata() { + return metadata; + } + + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public AccountHolderUpdateRequest migratedAccountHolderCode(String migratedAccountHolderCode) { + this.migratedAccountHolderCode = migratedAccountHolderCode; + return this; + } + + /** + * The unique identifier of the migrated account holder in the classic integration. + * @return migratedAccountHolderCode + **/ + @ApiModelProperty(value = "The unique identifier of the migrated account holder in the classic integration.") + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMigratedAccountHolderCode() { + return migratedAccountHolderCode; + } + + + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMigratedAccountHolderCode(String migratedAccountHolderCode) { + this.migratedAccountHolderCode = migratedAccountHolderCode; + } + + + public AccountHolderUpdateRequest primaryBalanceAccount(String primaryBalanceAccount) { + this.primaryBalanceAccount = primaryBalanceAccount; + return this; + } + + /** + * The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. + * @return primaryBalanceAccount + **/ + @ApiModelProperty(value = "The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request.") + @JsonProperty(JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrimaryBalanceAccount() { + return primaryBalanceAccount; + } + + + @JsonProperty(JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryBalanceAccount(String primaryBalanceAccount) { + this.primaryBalanceAccount = primaryBalanceAccount; + } + + + public AccountHolderUpdateRequest reference(String reference) { + this.reference = reference; + return this; + } + + /** + * Your reference for the account holder, maximum 150 characters. + * @return reference + **/ + @ApiModelProperty(value = "Your reference for the account holder, maximum 150 characters.") + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getReference() { + return reference; + } + + + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + } + + + public AccountHolderUpdateRequest status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * @return status + **/ + @ApiModelProperty(value = "The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone.") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public AccountHolderUpdateRequest timeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @return timeZone + **/ + @ApiModelProperty(value = "The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @JsonProperty(JSON_PROPERTY_TIME_ZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTimeZone() { + return timeZone; + } + + + @JsonProperty(JSON_PROPERTY_TIME_ZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } + + + public AccountHolderUpdateRequest verificationDeadlines(List verificationDeadlines) { + this.verificationDeadlines = verificationDeadlines; + return this; + } + + public AccountHolderUpdateRequest addVerificationDeadlinesItem(VerificationDeadline verificationDeadlinesItem) { + if (this.verificationDeadlines == null) { + this.verificationDeadlines = new ArrayList<>(); + } + this.verificationDeadlines.add(verificationDeadlinesItem); + return this; + } + + /** + * List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. + * @return verificationDeadlines + **/ + @ApiModelProperty(value = "List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved.") + @JsonProperty(JSON_PROPERTY_VERIFICATION_DEADLINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getVerificationDeadlines() { + return verificationDeadlines; + } + + + @JsonProperty(JSON_PROPERTY_VERIFICATION_DEADLINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVerificationDeadlines(List verificationDeadlines) { + this.verificationDeadlines = verificationDeadlines; + } + + + /** + * Return true if this AccountHolderUpdateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountHolderUpdateRequest accountHolderUpdateRequest = (AccountHolderUpdateRequest) o; + return Objects.equals(this.balancePlatform, accountHolderUpdateRequest.balancePlatform) && + Objects.equals(this.capabilities, accountHolderUpdateRequest.capabilities) && + Objects.equals(this.contactDetails, accountHolderUpdateRequest.contactDetails) && + Objects.equals(this.description, accountHolderUpdateRequest.description) && + Objects.equals(this.metadata, accountHolderUpdateRequest.metadata) && + Objects.equals(this.migratedAccountHolderCode, accountHolderUpdateRequest.migratedAccountHolderCode) && + Objects.equals(this.primaryBalanceAccount, accountHolderUpdateRequest.primaryBalanceAccount) && + Objects.equals(this.reference, accountHolderUpdateRequest.reference) && + Objects.equals(this.status, accountHolderUpdateRequest.status) && + Objects.equals(this.timeZone, accountHolderUpdateRequest.timeZone) && + Objects.equals(this.verificationDeadlines, accountHolderUpdateRequest.verificationDeadlines); + } + + @Override + public int hashCode() { + return Objects.hash(balancePlatform, capabilities, contactDetails, description, metadata, migratedAccountHolderCode, primaryBalanceAccount, reference, status, timeZone, verificationDeadlines); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountHolderUpdateRequest {\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" contactDetails: ").append(toIndentedString(contactDetails)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" migratedAccountHolderCode: ").append(toIndentedString(migratedAccountHolderCode)).append("\n"); + sb.append(" primaryBalanceAccount: ").append(toIndentedString(primaryBalanceAccount)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" verificationDeadlines: ").append(toIndentedString(verificationDeadlines)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of AccountHolderUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountHolderUpdateRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to AccountHolderUpdateRequest + */ + public static AccountHolderUpdateRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AccountHolderUpdateRequest.class); + } +/** + * Convert an instance of AccountHolderUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java new file mode 100644 index 000000000..623a64b37 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java @@ -0,0 +1,254 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * BRLocalAccountIdentification + */ +@JsonPropertyOrder({ + BRLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + BRLocalAccountIdentification.JSON_PROPERTY_BANK_CODE, + BRLocalAccountIdentification.JSON_PROPERTY_BRANCH_NUMBER, + BRLocalAccountIdentification.JSON_PROPERTY_TYPE +}) + +public class BRLocalAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; + private String bankCode; + + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; + private String branchNumber; + + /** + * **brLocal** + */ + public enum TypeEnum { + BRLOCAL("brLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type = TypeEnum.BRLOCAL; + + public BRLocalAccountIdentification() { + } + + public BRLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The bank account number, without separators or whitespace.") + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountNumber() { + return accountNumber; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public BRLocalAccountIdentification bankCode(String bankCode) { + this.bankCode = bankCode; + return this; + } + + /** + * The 3-digit bank code, with leading zeros. + * @return bankCode + **/ + @ApiModelProperty(required = true, value = "The 3-digit bank code, with leading zeros.") + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBankCode() { + return bankCode; + } + + + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + + public BRLocalAccountIdentification branchNumber(String branchNumber) { + this.branchNumber = branchNumber; + return this; + } + + /** + * The bank account branch number, without separators or whitespace. + * @return branchNumber + **/ + @ApiModelProperty(required = true, value = "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; + } + + + @JsonProperty(JSON_PROPERTY_BRANCH_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBranchNumber(String branchNumber) { + this.branchNumber = branchNumber; + } + + + public BRLocalAccountIdentification type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * **brLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**brLocal**") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + /** + * 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.bankCode, brLocalAccountIdentification.bankCode) && + Objects.equals(this.branchNumber, brLocalAccountIdentification.branchNumber) && + Objects.equals(this.type, brLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bankCode, branchNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BRLocalAccountIdentification {\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(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of 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/balanceplatform/Balance.java b/src/main/java/com/adyen/model/balanceplatform/Balance.java index e534a79e3..913d4b83d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Balance.java +++ b/src/main/java/com/adyen/model/balanceplatform/Balance.java @@ -34,6 +34,7 @@ Balance.JSON_PROPERTY_AVAILABLE, Balance.JSON_PROPERTY_BALANCE, Balance.JSON_PROPERTY_CURRENCY, + Balance.JSON_PROPERTY_PENDING, Balance.JSON_PROPERTY_RESERVED }) @@ -47,6 +48,9 @@ public class Balance { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + public static final String JSON_PROPERTY_PENDING = "pending"; + private Long pending; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; @@ -128,6 +132,31 @@ public void setCurrency(String currency) { } + public Balance pending(Long pending) { + this.pending = pending; + return this; + } + + /** + * The amount pending to be paid out but not yet available in the balance. + * @return pending + **/ + @ApiModelProperty(value = "The amount pending to be paid out but not yet available in the balance.") + @JsonProperty(JSON_PROPERTY_PENDING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getPending() { + return pending; + } + + + @JsonProperty(JSON_PROPERTY_PENDING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPending(Long pending) { + this.pending = pending; + } + + public Balance reserved(Long reserved) { this.reserved = reserved; return this; @@ -168,12 +197,13 @@ public boolean equals(Object o) { return Objects.equals(this.available, balance.available) && Objects.equals(this.balance, balance.balance) && Objects.equals(this.currency, balance.currency) && + Objects.equals(this.pending, balance.pending) && Objects.equals(this.reserved, balance.reserved); } @Override public int hashCode() { - return Objects.hash(available, balance, currency, reserved); + return Objects.hash(available, balance, currency, pending, reserved); } @Override @@ -183,6 +213,7 @@ public String toString() { sb.append(" available: ").append(toIndentedString(available)).append("\n"); sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" pending: ").append(toIndentedString(pending)).append("\n"); sb.append(" reserved: ").append(toIndentedString(reserved)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java index d41fa62bd..5a0b13a6b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java @@ -17,6 +17,7 @@ import java.util.Map; import java.util.HashMap; import com.adyen.model.balanceplatform.Balance; +import com.adyen.model.balanceplatform.PlatformPaymentConfiguration; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -42,6 +43,8 @@ BalanceAccount.JSON_PROPERTY_DESCRIPTION, BalanceAccount.JSON_PROPERTY_ID, BalanceAccount.JSON_PROPERTY_METADATA, + BalanceAccount.JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, + BalanceAccount.JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, BalanceAccount.JSON_PROPERTY_REFERENCE, BalanceAccount.JSON_PROPERTY_STATUS, BalanceAccount.JSON_PROPERTY_TIME_ZONE @@ -66,6 +69,12 @@ public class BalanceAccount { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata = null; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; + private String migratedAccountCode; + + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; + private PlatformPaymentConfiguration platformPaymentConfiguration; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; @@ -264,10 +273,10 @@ public BalanceAccount putMetadataItem(String key, String metadataItem) { } /** - * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * @return metadata **/ - @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + @ApiModelProperty(value = "A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -283,6 +292,56 @@ public void setMetadata(Map metadata) { } + public BalanceAccount migratedAccountCode(String migratedAccountCode) { + this.migratedAccountCode = migratedAccountCode; + return this; + } + + /** + * The unique identifier of the account of the migrated account holder in the classic integration. + * @return migratedAccountCode + **/ + @ApiModelProperty(value = "The unique identifier of the account of the migrated account holder in the classic integration.") + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMigratedAccountCode() { + return migratedAccountCode; + } + + + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMigratedAccountCode(String migratedAccountCode) { + this.migratedAccountCode = migratedAccountCode; + } + + + public BalanceAccount platformPaymentConfiguration(PlatformPaymentConfiguration platformPaymentConfiguration) { + this.platformPaymentConfiguration = platformPaymentConfiguration; + return this; + } + + /** + * Get platformPaymentConfiguration + * @return platformPaymentConfiguration + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { + return platformPaymentConfiguration; + } + + + @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlatformPaymentConfiguration(PlatformPaymentConfiguration platformPaymentConfiguration) { + this.platformPaymentConfiguration = platformPaymentConfiguration; + } + + public BalanceAccount reference(String reference) { this.reference = reference; return this; @@ -376,6 +435,8 @@ public boolean equals(Object o) { Objects.equals(this.description, balanceAccount.description) && Objects.equals(this.id, balanceAccount.id) && Objects.equals(this.metadata, balanceAccount.metadata) && + Objects.equals(this.migratedAccountCode, balanceAccount.migratedAccountCode) && + Objects.equals(this.platformPaymentConfiguration, balanceAccount.platformPaymentConfiguration) && Objects.equals(this.reference, balanceAccount.reference) && Objects.equals(this.status, balanceAccount.status) && Objects.equals(this.timeZone, balanceAccount.timeZone); @@ -383,7 +444,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountHolderId, balances, defaultCurrencyCode, description, id, metadata, reference, status, timeZone); + return Objects.hash(accountHolderId, balances, defaultCurrencyCode, description, id, metadata, migratedAccountCode, platformPaymentConfiguration, reference, status, timeZone); } @Override @@ -396,6 +457,8 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" migratedAccountCode: ").append(toIndentedString(migratedAccountCode)).append("\n"); + sb.append(" platformPaymentConfiguration: ").append(toIndentedString(platformPaymentConfiguration)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java index ed51296d7..1ac86df7b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java @@ -16,6 +16,7 @@ import java.util.Arrays; import java.util.Map; import java.util.HashMap; +import com.adyen.model.balanceplatform.PlatformPaymentConfiguration; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -39,6 +40,8 @@ BalanceAccountBase.JSON_PROPERTY_DESCRIPTION, BalanceAccountBase.JSON_PROPERTY_ID, BalanceAccountBase.JSON_PROPERTY_METADATA, + BalanceAccountBase.JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, + BalanceAccountBase.JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, BalanceAccountBase.JSON_PROPERTY_REFERENCE, BalanceAccountBase.JSON_PROPERTY_STATUS, BalanceAccountBase.JSON_PROPERTY_TIME_ZONE @@ -60,6 +63,12 @@ public class BalanceAccountBase { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata = null; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; + private String migratedAccountCode; + + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; + private PlatformPaymentConfiguration platformPaymentConfiguration; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; @@ -225,10 +234,10 @@ public BalanceAccountBase putMetadataItem(String key, String metadataItem) { } /** - * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * @return metadata **/ - @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + @ApiModelProperty(value = "A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -244,6 +253,56 @@ public void setMetadata(Map metadata) { } + public BalanceAccountBase migratedAccountCode(String migratedAccountCode) { + this.migratedAccountCode = migratedAccountCode; + return this; + } + + /** + * The unique identifier of the account of the migrated account holder in the classic integration. + * @return migratedAccountCode + **/ + @ApiModelProperty(value = "The unique identifier of the account of the migrated account holder in the classic integration.") + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMigratedAccountCode() { + return migratedAccountCode; + } + + + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMigratedAccountCode(String migratedAccountCode) { + this.migratedAccountCode = migratedAccountCode; + } + + + public BalanceAccountBase platformPaymentConfiguration(PlatformPaymentConfiguration platformPaymentConfiguration) { + this.platformPaymentConfiguration = platformPaymentConfiguration; + return this; + } + + /** + * Get platformPaymentConfiguration + * @return platformPaymentConfiguration + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { + return platformPaymentConfiguration; + } + + + @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlatformPaymentConfiguration(PlatformPaymentConfiguration platformPaymentConfiguration) { + this.platformPaymentConfiguration = platformPaymentConfiguration; + } + + public BalanceAccountBase reference(String reference) { this.reference = reference; return this; @@ -336,6 +395,8 @@ public boolean equals(Object o) { Objects.equals(this.description, balanceAccountBase.description) && Objects.equals(this.id, balanceAccountBase.id) && Objects.equals(this.metadata, balanceAccountBase.metadata) && + Objects.equals(this.migratedAccountCode, balanceAccountBase.migratedAccountCode) && + Objects.equals(this.platformPaymentConfiguration, balanceAccountBase.platformPaymentConfiguration) && Objects.equals(this.reference, balanceAccountBase.reference) && Objects.equals(this.status, balanceAccountBase.status) && Objects.equals(this.timeZone, balanceAccountBase.timeZone); @@ -343,7 +404,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountHolderId, defaultCurrencyCode, description, id, metadata, reference, status, timeZone); + return Objects.hash(accountHolderId, defaultCurrencyCode, description, id, metadata, migratedAccountCode, platformPaymentConfiguration, reference, status, timeZone); } @Override @@ -355,6 +416,8 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" migratedAccountCode: ").append(toIndentedString(migratedAccountCode)).append("\n"); + sb.append(" platformPaymentConfiguration: ").append(toIndentedString(platformPaymentConfiguration)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java index d399fa364..b1c559549 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java @@ -16,6 +16,7 @@ import java.util.Arrays; import java.util.Map; import java.util.HashMap; +import com.adyen.model.balanceplatform.PlatformPaymentConfiguration; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -38,6 +39,8 @@ BalanceAccountInfo.JSON_PROPERTY_DEFAULT_CURRENCY_CODE, BalanceAccountInfo.JSON_PROPERTY_DESCRIPTION, BalanceAccountInfo.JSON_PROPERTY_METADATA, + BalanceAccountInfo.JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, + BalanceAccountInfo.JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, BalanceAccountInfo.JSON_PROPERTY_REFERENCE, BalanceAccountInfo.JSON_PROPERTY_TIME_ZONE }) @@ -55,6 +58,12 @@ public class BalanceAccountInfo { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata = null; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; + private String migratedAccountCode; + + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; + private PlatformPaymentConfiguration platformPaymentConfiguration; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; @@ -153,10 +162,10 @@ public BalanceAccountInfo putMetadataItem(String key, String metadataItem) { } /** - * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * @return metadata **/ - @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + @ApiModelProperty(value = "A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -172,6 +181,56 @@ public void setMetadata(Map metadata) { } + public BalanceAccountInfo migratedAccountCode(String migratedAccountCode) { + this.migratedAccountCode = migratedAccountCode; + return this; + } + + /** + * The unique identifier of the account of the migrated account holder in the classic integration. + * @return migratedAccountCode + **/ + @ApiModelProperty(value = "The unique identifier of the account of the migrated account holder in the classic integration.") + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMigratedAccountCode() { + return migratedAccountCode; + } + + + @JsonProperty(JSON_PROPERTY_MIGRATED_ACCOUNT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMigratedAccountCode(String migratedAccountCode) { + this.migratedAccountCode = migratedAccountCode; + } + + + public BalanceAccountInfo platformPaymentConfiguration(PlatformPaymentConfiguration platformPaymentConfiguration) { + this.platformPaymentConfiguration = platformPaymentConfiguration; + return this; + } + + /** + * Get platformPaymentConfiguration + * @return platformPaymentConfiguration + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { + return platformPaymentConfiguration; + } + + + @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlatformPaymentConfiguration(PlatformPaymentConfiguration platformPaymentConfiguration) { + this.platformPaymentConfiguration = platformPaymentConfiguration; + } + + public BalanceAccountInfo reference(String reference) { this.reference = reference; return this; @@ -238,13 +297,15 @@ public boolean equals(Object o) { Objects.equals(this.defaultCurrencyCode, balanceAccountInfo.defaultCurrencyCode) && Objects.equals(this.description, balanceAccountInfo.description) && Objects.equals(this.metadata, balanceAccountInfo.metadata) && + Objects.equals(this.migratedAccountCode, balanceAccountInfo.migratedAccountCode) && + Objects.equals(this.platformPaymentConfiguration, balanceAccountInfo.platformPaymentConfiguration) && Objects.equals(this.reference, balanceAccountInfo.reference) && Objects.equals(this.timeZone, balanceAccountInfo.timeZone); } @Override public int hashCode() { - return Objects.hash(accountHolderId, defaultCurrencyCode, description, metadata, reference, timeZone); + return Objects.hash(accountHolderId, defaultCurrencyCode, description, metadata, migratedAccountCode, platformPaymentConfiguration, reference, timeZone); } @Override @@ -255,6 +316,8 @@ public String toString() { sb.append(" defaultCurrencyCode: ").append(toIndentedString(defaultCurrencyCode)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" migratedAccountCode: ").append(toIndentedString(migratedAccountCode)).append("\n"); + sb.append(" platformPaymentConfiguration: ").append(toIndentedString(platformPaymentConfiguration)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); sb.append("}"); diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java index ac7b7f811..abf49eb61 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java @@ -16,6 +16,7 @@ import java.util.Arrays; import java.util.Map; import java.util.HashMap; +import com.adyen.model.balanceplatform.PlatformPaymentConfiguration; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -38,6 +39,7 @@ BalanceAccountUpdateRequest.JSON_PROPERTY_DEFAULT_CURRENCY_CODE, BalanceAccountUpdateRequest.JSON_PROPERTY_DESCRIPTION, BalanceAccountUpdateRequest.JSON_PROPERTY_METADATA, + BalanceAccountUpdateRequest.JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, BalanceAccountUpdateRequest.JSON_PROPERTY_REFERENCE, BalanceAccountUpdateRequest.JSON_PROPERTY_STATUS, BalanceAccountUpdateRequest.JSON_PROPERTY_TIME_ZONE @@ -56,6 +58,9 @@ public class BalanceAccountUpdateRequest { public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata = null; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; + private PlatformPaymentConfiguration platformPaymentConfiguration; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; @@ -196,10 +201,10 @@ public BalanceAccountUpdateRequest putMetadataItem(String key, String metadataIt } /** - * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. * @return metadata **/ - @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + @ApiModelProperty(value = "A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") @JsonProperty(JSON_PROPERTY_METADATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -215,6 +220,31 @@ public void setMetadata(Map metadata) { } + public BalanceAccountUpdateRequest platformPaymentConfiguration(PlatformPaymentConfiguration platformPaymentConfiguration) { + this.platformPaymentConfiguration = platformPaymentConfiguration; + return this; + } + + /** + * Get platformPaymentConfiguration + * @return platformPaymentConfiguration + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { + return platformPaymentConfiguration; + } + + + @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlatformPaymentConfiguration(PlatformPaymentConfiguration platformPaymentConfiguration) { + this.platformPaymentConfiguration = platformPaymentConfiguration; + } + + public BalanceAccountUpdateRequest reference(String reference) { this.reference = reference; return this; @@ -306,6 +336,7 @@ public boolean equals(Object o) { Objects.equals(this.defaultCurrencyCode, balanceAccountUpdateRequest.defaultCurrencyCode) && Objects.equals(this.description, balanceAccountUpdateRequest.description) && Objects.equals(this.metadata, balanceAccountUpdateRequest.metadata) && + Objects.equals(this.platformPaymentConfiguration, balanceAccountUpdateRequest.platformPaymentConfiguration) && Objects.equals(this.reference, balanceAccountUpdateRequest.reference) && Objects.equals(this.status, balanceAccountUpdateRequest.status) && Objects.equals(this.timeZone, balanceAccountUpdateRequest.timeZone); @@ -313,7 +344,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountHolderId, defaultCurrencyCode, description, metadata, reference, status, timeZone); + return Objects.hash(accountHolderId, defaultCurrencyCode, description, metadata, platformPaymentConfiguration, reference, status, timeZone); } @Override @@ -324,6 +355,7 @@ public String toString() { sb.append(" defaultCurrencyCode: ").append(toIndentedString(defaultCurrencyCode)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" platformPaymentConfiguration: ").append(toIndentedString(platformPaymentConfiguration)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java index 029fe22ca..13c7c50d1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java @@ -18,11 +18,15 @@ import java.util.HashMap; import com.adyen.model.balanceplatform.AULocalAccountIdentification; import com.adyen.model.balanceplatform.AdditionalBankIdentification; +import com.adyen.model.balanceplatform.BRLocalAccountIdentification; import com.adyen.model.balanceplatform.CALocalAccountIdentification; import com.adyen.model.balanceplatform.CZLocalAccountIdentification; +import com.adyen.model.balanceplatform.DKLocalAccountIdentification; +import com.adyen.model.balanceplatform.HKLocalAccountIdentification; import com.adyen.model.balanceplatform.HULocalAccountIdentification; import com.adyen.model.balanceplatform.IbanAccountIdentification; import com.adyen.model.balanceplatform.NOLocalAccountIdentification; +import com.adyen.model.balanceplatform.NZLocalAccountIdentification; import com.adyen.model.balanceplatform.NumberAndBicAccountIdentification; import com.adyen.model.balanceplatform.PLLocalAccountIdentification; import com.adyen.model.balanceplatform.SELocalAccountIdentification; @@ -136,6 +140,34 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali } + // deserialize BRLocalAccountIdentification + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (BRLocalAccountIdentification.class.equals(Integer.class) || BRLocalAccountIdentification.class.equals(Long.class) || BRLocalAccountIdentification.class.equals(Float.class) || BRLocalAccountIdentification.class.equals(Double.class) || BRLocalAccountIdentification.class.equals(Boolean.class) || BRLocalAccountIdentification.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((BRLocalAccountIdentification.class.equals(Integer.class) || BRLocalAccountIdentification.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((BRLocalAccountIdentification.class.equals(Float.class) || BRLocalAccountIdentification.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (BRLocalAccountIdentification.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (BRLocalAccountIdentification.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + // Checks if the unique type of the oneOf json matches any of the object TypeEnum values + boolean typeMatch = Arrays.stream(BRLocalAccountIdentification.TypeEnum.values()).anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText())); + if (attemptParsing || typeMatch) { + // Strict deserialization for oneOf models + deserialized = localObjectMapper.readValue(tree.toString(), BRLocalAccountIdentification.class); + // typeMatch should enforce proper deserialization + match++; + log.log(Level.FINER, "Input data matches schema 'BRLocalAccountIdentification'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'BRLocalAccountIdentification'", e); + } + + // deserialize CALocalAccountIdentification try { boolean attemptParsing = true; @@ -192,6 +224,62 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali } + // deserialize DKLocalAccountIdentification + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (DKLocalAccountIdentification.class.equals(Integer.class) || DKLocalAccountIdentification.class.equals(Long.class) || DKLocalAccountIdentification.class.equals(Float.class) || DKLocalAccountIdentification.class.equals(Double.class) || DKLocalAccountIdentification.class.equals(Boolean.class) || DKLocalAccountIdentification.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((DKLocalAccountIdentification.class.equals(Integer.class) || DKLocalAccountIdentification.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((DKLocalAccountIdentification.class.equals(Float.class) || DKLocalAccountIdentification.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (DKLocalAccountIdentification.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (DKLocalAccountIdentification.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + // Checks if the unique type of the oneOf json matches any of the object TypeEnum values + boolean typeMatch = Arrays.stream(DKLocalAccountIdentification.TypeEnum.values()).anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText())); + if (attemptParsing || typeMatch) { + // Strict deserialization for oneOf models + deserialized = localObjectMapper.readValue(tree.toString(), DKLocalAccountIdentification.class); + // typeMatch should enforce proper deserialization + match++; + log.log(Level.FINER, "Input data matches schema 'DKLocalAccountIdentification'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'DKLocalAccountIdentification'", e); + } + + + // deserialize HKLocalAccountIdentification + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (HKLocalAccountIdentification.class.equals(Integer.class) || HKLocalAccountIdentification.class.equals(Long.class) || HKLocalAccountIdentification.class.equals(Float.class) || HKLocalAccountIdentification.class.equals(Double.class) || HKLocalAccountIdentification.class.equals(Boolean.class) || HKLocalAccountIdentification.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((HKLocalAccountIdentification.class.equals(Integer.class) || HKLocalAccountIdentification.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((HKLocalAccountIdentification.class.equals(Float.class) || HKLocalAccountIdentification.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (HKLocalAccountIdentification.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (HKLocalAccountIdentification.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + // Checks if the unique type of the oneOf json matches any of the object TypeEnum values + boolean typeMatch = Arrays.stream(HKLocalAccountIdentification.TypeEnum.values()).anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText())); + if (attemptParsing || typeMatch) { + // Strict deserialization for oneOf models + deserialized = localObjectMapper.readValue(tree.toString(), HKLocalAccountIdentification.class); + // typeMatch should enforce proper deserialization + match++; + log.log(Level.FINER, "Input data matches schema 'HKLocalAccountIdentification'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'HKLocalAccountIdentification'", e); + } + + // deserialize HULocalAccountIdentification try { boolean attemptParsing = true; @@ -276,6 +364,34 @@ public BankAccountIdentificationValidationRequestAccountIdentification deseriali } + // deserialize NZLocalAccountIdentification + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (NZLocalAccountIdentification.class.equals(Integer.class) || NZLocalAccountIdentification.class.equals(Long.class) || NZLocalAccountIdentification.class.equals(Float.class) || NZLocalAccountIdentification.class.equals(Double.class) || NZLocalAccountIdentification.class.equals(Boolean.class) || NZLocalAccountIdentification.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((NZLocalAccountIdentification.class.equals(Integer.class) || NZLocalAccountIdentification.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((NZLocalAccountIdentification.class.equals(Float.class) || NZLocalAccountIdentification.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (NZLocalAccountIdentification.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (NZLocalAccountIdentification.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + // Checks if the unique type of the oneOf json matches any of the object TypeEnum values + boolean typeMatch = Arrays.stream(NZLocalAccountIdentification.TypeEnum.values()).anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText())); + if (attemptParsing || typeMatch) { + // Strict deserialization for oneOf models + deserialized = localObjectMapper.readValue(tree.toString(), NZLocalAccountIdentification.class); + // typeMatch should enforce proper deserialization + match++; + log.log(Level.FINER, "Input data matches schema 'NZLocalAccountIdentification'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'NZLocalAccountIdentification'", e); + } + + // deserialize NumberAndBicAccountIdentification try { boolean attemptParsing = true; @@ -479,6 +595,11 @@ public BankAccountIdentificationValidationRequestAccountIdentification(AULocalAc setActualInstance(o); } + public BankAccountIdentificationValidationRequestAccountIdentification(BRLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public BankAccountIdentificationValidationRequestAccountIdentification(CALocalAccountIdentification o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -489,6 +610,16 @@ public BankAccountIdentificationValidationRequestAccountIdentification(CZLocalAc setActualInstance(o); } + public BankAccountIdentificationValidationRequestAccountIdentification(DKLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(HKLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public BankAccountIdentificationValidationRequestAccountIdentification(HULocalAccountIdentification o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -504,6 +635,11 @@ public BankAccountIdentificationValidationRequestAccountIdentification(NOLocalAc setActualInstance(o); } + public BankAccountIdentificationValidationRequestAccountIdentification(NZLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public BankAccountIdentificationValidationRequestAccountIdentification(NumberAndBicAccountIdentification o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -537,16 +673,24 @@ public BankAccountIdentificationValidationRequestAccountIdentification(USLocalAc static { schemas.put("AULocalAccountIdentification", new GenericType() { }); + schemas.put("BRLocalAccountIdentification", new GenericType() { + }); schemas.put("CALocalAccountIdentification", new GenericType() { }); schemas.put("CZLocalAccountIdentification", new GenericType() { }); + schemas.put("DKLocalAccountIdentification", new GenericType() { + }); + schemas.put("HKLocalAccountIdentification", new GenericType() { + }); schemas.put("HULocalAccountIdentification", new GenericType() { }); schemas.put("IbanAccountIdentification", new GenericType() { }); schemas.put("NOLocalAccountIdentification", new GenericType() { }); + schemas.put("NZLocalAccountIdentification", new GenericType() { + }); schemas.put("NumberAndBicAccountIdentification", new GenericType() { }); schemas.put("PLLocalAccountIdentification", new GenericType() { @@ -570,7 +714,7 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification + * AULocalAccountIdentification, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NZLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). @@ -582,6 +726,11 @@ public void setActualInstance(Object instance) { return; } + if (JSON.isInstanceOf(BRLocalAccountIdentification.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(CALocalAccountIdentification.class, instance, new HashSet>())) { super.setActualInstance(instance); return; @@ -592,6 +741,16 @@ public void setActualInstance(Object instance) { return; } + if (JSON.isInstanceOf(DKLocalAccountIdentification.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(HKLocalAccountIdentification.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(HULocalAccountIdentification.class, instance, new HashSet>())) { super.setActualInstance(instance); return; @@ -607,6 +766,11 @@ public void setActualInstance(Object instance) { return; } + if (JSON.isInstanceOf(NZLocalAccountIdentification.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(NumberAndBicAccountIdentification.class, instance, new HashSet>())) { super.setActualInstance(instance); return; @@ -637,14 +801,14 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification"); + throw new RuntimeException("Invalid instance type. Must be AULocalAccountIdentification, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NZLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification"); } /** * Get the actual instance, which can be the following: - * AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification + * AULocalAccountIdentification, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NZLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification * - * @return The actual instance (AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification) + * @return The actual instance (AULocalAccountIdentification, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NZLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification) */ @Override public Object getActualInstance() { @@ -662,6 +826,17 @@ public AULocalAccountIdentification getAULocalAccountIdentification() throws Cla return (AULocalAccountIdentification)super.getActualInstance(); } + /** + * Get the actual instance of `BRLocalAccountIdentification`. If the actual instance is not `BRLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BRLocalAccountIdentification` + * @throws ClassCastException if the instance is not `BRLocalAccountIdentification` + */ + public BRLocalAccountIdentification getBRLocalAccountIdentification() throws ClassCastException { + return (BRLocalAccountIdentification)super.getActualInstance(); + } + /** * Get the actual instance of `CALocalAccountIdentification`. If the actual instance is not `CALocalAccountIdentification`, * the ClassCastException will be thrown. @@ -684,6 +859,28 @@ public CZLocalAccountIdentification getCZLocalAccountIdentification() throws Cla return (CZLocalAccountIdentification)super.getActualInstance(); } + /** + * Get the actual instance of `DKLocalAccountIdentification`. If the actual instance is not `DKLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DKLocalAccountIdentification` + * @throws ClassCastException if the instance is not `DKLocalAccountIdentification` + */ + public DKLocalAccountIdentification getDKLocalAccountIdentification() throws ClassCastException { + return (DKLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `HKLocalAccountIdentification`. If the actual instance is not `HKLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `HKLocalAccountIdentification` + * @throws ClassCastException if the instance is not `HKLocalAccountIdentification` + */ + public HKLocalAccountIdentification getHKLocalAccountIdentification() throws ClassCastException { + return (HKLocalAccountIdentification)super.getActualInstance(); + } + /** * Get the actual instance of `HULocalAccountIdentification`. If the actual instance is not `HULocalAccountIdentification`, * the ClassCastException will be thrown. @@ -717,6 +914,17 @@ public NOLocalAccountIdentification getNOLocalAccountIdentification() throws Cla return (NOLocalAccountIdentification)super.getActualInstance(); } + /** + * Get the actual instance of `NZLocalAccountIdentification`. If the actual instance is not `NZLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `NZLocalAccountIdentification` + * @throws ClassCastException if the instance is not `NZLocalAccountIdentification` + */ + public NZLocalAccountIdentification getNZLocalAccountIdentification() throws ClassCastException { + return (NZLocalAccountIdentification)super.getActualInstance(); + } + /** * Get the actual instance of `NumberAndBicAccountIdentification`. If the actual instance is not `NumberAndBicAccountIdentification`, * the ClassCastException will be thrown. diff --git a/src/main/java/com/adyen/model/balanceplatform/Card.java b/src/main/java/com/adyen/model/balanceplatform/Card.java index 16d0a7b43..a8839a882 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Card.java +++ b/src/main/java/com/adyen/model/balanceplatform/Card.java @@ -46,7 +46,8 @@ Card.JSON_PROPERTY_EXPIRATION, Card.JSON_PROPERTY_FORM_FACTOR, Card.JSON_PROPERTY_LAST_FOUR, - Card.JSON_PROPERTY_NUMBER + Card.JSON_PROPERTY_NUMBER, + Card.JSON_PROPERTY_THREE_D_SECURE }) public class Card { @@ -123,6 +124,9 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; + private String threeDSecure; + public Card() { } @@ -207,10 +211,10 @@ public Card brandVariant(String brandVariant) { } /** - * The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration. * @return brandVariant **/ - @ApiModelProperty(required = true, value = "The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**.") + @ApiModelProperty(required = true, value = "The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration.") @JsonProperty(JSON_PROPERTY_BRAND_VARIANT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -426,6 +430,31 @@ public void setNumber(String number) { } + public Card threeDSecure(String threeDSecure) { + this.threeDSecure = threeDSecure; + return this; + } + + /** + * Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySecure**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. + * @return threeDSecure + **/ + @ApiModelProperty(value = "Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySecure**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration.") + @JsonProperty(JSON_PROPERTY_THREE_D_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getThreeDSecure() { + return threeDSecure; + } + + + @JsonProperty(JSON_PROPERTY_THREE_D_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeDSecure(String threeDSecure) { + this.threeDSecure = threeDSecure; + } + + /** * Return true if this Card object is equal to o. */ @@ -449,12 +478,13 @@ public boolean equals(Object o) { Objects.equals(this.expiration, card.expiration) && Objects.equals(this.formFactor, card.formFactor) && Objects.equals(this.lastFour, card.lastFour) && - Objects.equals(this.number, card.number); + Objects.equals(this.number, card.number) && + Objects.equals(this.threeDSecure, card.threeDSecure); } @Override public int hashCode() { - return Objects.hash(authentication, bin, brand, brandVariant, cardholderName, configuration, cvc, deliveryContact, expiration, formFactor, lastFour, number); + return Objects.hash(authentication, bin, brand, brandVariant, cardholderName, configuration, cvc, deliveryContact, expiration, formFactor, lastFour, number, threeDSecure); } @Override @@ -473,6 +503,7 @@ public String toString() { sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); sb.append(" lastFour: ").append(toIndentedString(lastFour)).append("\n"); sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" threeDSecure: ").append(toIndentedString(threeDSecure)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java index 2e8cf82c9..6685de177 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java @@ -40,7 +40,8 @@ CardInfo.JSON_PROPERTY_CARDHOLDER_NAME, CardInfo.JSON_PROPERTY_CONFIGURATION, CardInfo.JSON_PROPERTY_DELIVERY_CONTACT, - CardInfo.JSON_PROPERTY_FORM_FACTOR + CardInfo.JSON_PROPERTY_FORM_FACTOR, + CardInfo.JSON_PROPERTY_THREE_D_SECURE }) public class CardInfo { @@ -102,6 +103,9 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private FormFactorEnum formFactor; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; + private String threeDSecure; + public CardInfo() { } @@ -161,10 +165,10 @@ public CardInfo brandVariant(String brandVariant) { } /** - * The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration. * @return brandVariant **/ - @ApiModelProperty(required = true, value = "The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**.") + @ApiModelProperty(required = true, value = "The brand variant of the physical or the virtual card. For example, **visadebit** or **mcprepaid**. >Reach out to your Adyen contact to get the values relevant for your integration.") @JsonProperty(JSON_PROPERTY_BRAND_VARIANT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -280,6 +284,31 @@ public void setFormFactor(FormFactorEnum formFactor) { } + public CardInfo threeDSecure(String threeDSecure) { + this.threeDSecure = threeDSecure; + return this; + } + + /** + * Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySecure**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration. + * @return threeDSecure + **/ + @ApiModelProperty(value = "Allocates a specific product range for either a physical or a virtual card. Possible values: **fullySecure**, **secureCorporate**. >Reach out to your Adyen contact to get the values relevant for your integration.") + @JsonProperty(JSON_PROPERTY_THREE_D_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getThreeDSecure() { + return threeDSecure; + } + + + @JsonProperty(JSON_PROPERTY_THREE_D_SECURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreeDSecure(String threeDSecure) { + this.threeDSecure = threeDSecure; + } + + /** * Return true if this CardInfo object is equal to o. */ @@ -298,12 +327,13 @@ public boolean equals(Object o) { Objects.equals(this.cardholderName, cardInfo.cardholderName) && Objects.equals(this.configuration, cardInfo.configuration) && Objects.equals(this.deliveryContact, cardInfo.deliveryContact) && - Objects.equals(this.formFactor, cardInfo.formFactor); + Objects.equals(this.formFactor, cardInfo.formFactor) && + Objects.equals(this.threeDSecure, cardInfo.threeDSecure); } @Override public int hashCode() { - return Objects.hash(authentication, brand, brandVariant, cardholderName, configuration, deliveryContact, formFactor); + return Objects.hash(authentication, brand, brandVariant, cardholderName, configuration, deliveryContact, formFactor, threeDSecure); } @Override @@ -317,6 +347,7 @@ public String toString() { sb.append(" configuration: ").append(toIndentedString(configuration)).append("\n"); sb.append(" deliveryContact: ").append(toIndentedString(deliveryContact)).append("\n"); sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); + sb.append(" threeDSecure: ").append(toIndentedString(threeDSecure)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java b/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java deleted file mode 100644 index 145cc369b..000000000 --- a/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Configuration API - * - * The version of the OpenAPI document: 2 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.model.balanceplatform; - -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.core.JsonProcessingException; - - -/** - * CronSweepSchedule - */ -@JsonPropertyOrder({ - CronSweepSchedule.JSON_PROPERTY_CRON_EXPRESSION, - CronSweepSchedule.JSON_PROPERTY_TYPE -}) - -public class CronSweepSchedule { - public static final String JSON_PROPERTY_CRON_EXPRESSION = "cronExpression"; - private String cronExpression; - - /** - * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. - */ - public enum TypeEnum { - DAILY("daily"), - - WEEKLY("weekly"), - - MONTHLY("monthly"), - - BALANCE("balance"), - - CRON("cron"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - private TypeEnum type; - - public CronSweepSchedule() { - } - - public CronSweepSchedule cronExpression(String cronExpression) { - this.cronExpression = cronExpression; - return this; - } - - /** - * A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: **&ast;**, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. - * @return cronExpression - **/ - @ApiModelProperty(required = true, value = "A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples.") - @JsonProperty(JSON_PROPERTY_CRON_EXPRESSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCronExpression() { - return cronExpression; - } - - - @JsonProperty(JSON_PROPERTY_CRON_EXPRESSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCronExpression(String cronExpression) { - this.cronExpression = cronExpression; - } - - - public CronSweepSchedule type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. - * @return type - **/ - @ApiModelProperty(value = "The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction.") - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TypeEnum getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(TypeEnum type) { - this.type = type; - } - - - /** - * Return true if this CronSweepSchedule object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CronSweepSchedule cronSweepSchedule = (CronSweepSchedule) o; - return Objects.equals(this.cronExpression, cronSweepSchedule.cronExpression) && - Objects.equals(this.type, cronSweepSchedule.type); - } - - @Override - public int hashCode() { - return Objects.hash(cronExpression, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CronSweepSchedule {\n"); - sb.append(" cronExpression: ").append(toIndentedString(cronExpression)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -/** - * Create an instance of CronSweepSchedule given an JSON string - * - * @param jsonString JSON string - * @return An instance of CronSweepSchedule - * @throws JsonProcessingException if the JSON string is invalid with respect to CronSweepSchedule - */ - public static CronSweepSchedule fromJson(String jsonString) throws JsonProcessingException { - return JSON.getMapper().readValue(jsonString, CronSweepSchedule.class); - } -/** - * Convert an instance of CronSweepSchedule to an JSON string - * - * @return JSON string - */ - public String toJson() throws JsonProcessingException { - return JSON.getMapper().writeValueAsString(this); - } -} - diff --git a/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java new file mode 100644 index 000000000..076fe3458 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java @@ -0,0 +1,223 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * DKLocalAccountIdentification + */ +@JsonPropertyOrder({ + DKLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + DKLocalAccountIdentification.JSON_PROPERTY_BANK_CODE, + DKLocalAccountIdentification.JSON_PROPERTY_TYPE +}) + +public class DKLocalAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; + private String bankCode; + + /** + * **dkLocal** + */ + public enum TypeEnum { + DKLOCAL("dkLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type = TypeEnum.DKLOCAL; + + public DKLocalAccountIdentification() { + } + + public DKLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "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; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public DKLocalAccountIdentification bankCode(String bankCode) { + this.bankCode = bankCode; + return this; + } + + /** + * The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * @return bankCode + **/ + @ApiModelProperty(required = true, value = "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; + } + + + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + + public DKLocalAccountIdentification type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * **dkLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**dkLocal**") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + /** + * 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.bankCode, dkLocalAccountIdentification.bankCode) && + Objects.equals(this.type, dkLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bankCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DKLocalAccountIdentification {\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 "); + } + +/** + * 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/balanceplatform/DeviceInfo.java b/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java new file mode 100644 index 000000000..73a6abcff --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java @@ -0,0 +1,448 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * DeviceInfo + */ +@JsonPropertyOrder({ + DeviceInfo.JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY, + DeviceInfo.JSON_PROPERTY_DEVICE_NAME, + DeviceInfo.JSON_PROPERTY_FORM_FACTOR, + DeviceInfo.JSON_PROPERTY_IMEI, + DeviceInfo.JSON_PROPERTY_ISO_DEVICE_TYPE, + DeviceInfo.JSON_PROPERTY_MSISDN, + DeviceInfo.JSON_PROPERTY_OS_NAME, + DeviceInfo.JSON_PROPERTY_OS_VERSION, + DeviceInfo.JSON_PROPERTY_PAYMENT_TYPES, + DeviceInfo.JSON_PROPERTY_SERIAL_NUMBER, + DeviceInfo.JSON_PROPERTY_STORAGE_TECHNOLOGY +}) + +public class DeviceInfo { + public static final String JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY = "cardCaptureTechnology"; + private String cardCaptureTechnology; + + public static final String JSON_PROPERTY_DEVICE_NAME = "deviceName"; + private String deviceName; + + public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; + private String formFactor; + + public static final String JSON_PROPERTY_IMEI = "imei"; + private String imei; + + public static final String JSON_PROPERTY_ISO_DEVICE_TYPE = "isoDeviceType"; + private String isoDeviceType; + + public static final String JSON_PROPERTY_MSISDN = "msisdn"; + private String msisdn; + + public static final String JSON_PROPERTY_OS_NAME = "osName"; + private String osName; + + public static final String JSON_PROPERTY_OS_VERSION = "osVersion"; + private String osVersion; + + public static final String JSON_PROPERTY_PAYMENT_TYPES = "paymentTypes"; + private List paymentTypes = null; + + public static final String JSON_PROPERTY_SERIAL_NUMBER = "serialNumber"; + private String serialNumber; + + public static final String JSON_PROPERTY_STORAGE_TECHNOLOGY = "storageTechnology"; + private String storageTechnology; + + public DeviceInfo() { + } + + public DeviceInfo cardCaptureTechnology(String cardCaptureTechnology) { + this.cardCaptureTechnology = cardCaptureTechnology; + return this; + } + + /** + * The technology used to capture the card details. + * @return cardCaptureTechnology + **/ + @ApiModelProperty(value = "The technology used to capture the card details.") + @JsonProperty(JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCardCaptureTechnology() { + return cardCaptureTechnology; + } + + + @JsonProperty(JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardCaptureTechnology(String cardCaptureTechnology) { + this.cardCaptureTechnology = cardCaptureTechnology; + } + + + public DeviceInfo deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * The name of the device. + * @return deviceName + **/ + @ApiModelProperty(value = "The name of the device.") + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDeviceName() { + return deviceName; + } + + + @JsonProperty(JSON_PROPERTY_DEVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + + public DeviceInfo formFactor(String formFactor) { + this.formFactor = formFactor; + return this; + } + + /** + * The form factor of the device to be provisioned. + * @return formFactor + **/ + @ApiModelProperty(value = "The form factor of the device to be provisioned.") + @JsonProperty(JSON_PROPERTY_FORM_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFormFactor() { + return formFactor; + } + + + @JsonProperty(JSON_PROPERTY_FORM_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFactor(String formFactor) { + this.formFactor = formFactor; + } + + + public DeviceInfo imei(String imei) { + this.imei = imei; + return this; + } + + /** + * The IMEI number of the device being provisioned. + * @return imei + **/ + @ApiModelProperty(value = "The IMEI number of the device being provisioned.") + @JsonProperty(JSON_PROPERTY_IMEI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getImei() { + return imei; + } + + + @JsonProperty(JSON_PROPERTY_IMEI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImei(String imei) { + this.imei = imei; + } + + + public DeviceInfo isoDeviceType(String isoDeviceType) { + this.isoDeviceType = isoDeviceType; + return this; + } + + /** + * The 2-digit device type provided on the ISO messages that the token is being provisioned to. + * @return isoDeviceType + **/ + @ApiModelProperty(value = "The 2-digit device type provided on the ISO messages that the token is being provisioned to.") + @JsonProperty(JSON_PROPERTY_ISO_DEVICE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIsoDeviceType() { + return isoDeviceType; + } + + + @JsonProperty(JSON_PROPERTY_ISO_DEVICE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsoDeviceType(String isoDeviceType) { + this.isoDeviceType = isoDeviceType; + } + + + public DeviceInfo msisdn(String msisdn) { + this.msisdn = msisdn; + return this; + } + + /** + * The MSISDN of the device being provisioned. + * @return msisdn + **/ + @ApiModelProperty(value = "The MSISDN of the device being provisioned.") + @JsonProperty(JSON_PROPERTY_MSISDN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMsisdn() { + return msisdn; + } + + + @JsonProperty(JSON_PROPERTY_MSISDN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMsisdn(String msisdn) { + this.msisdn = msisdn; + } + + + public DeviceInfo osName(String osName) { + this.osName = osName; + return this; + } + + /** + * The name of the device operating system. + * @return osName + **/ + @ApiModelProperty(value = "The name of the device operating system.") + @JsonProperty(JSON_PROPERTY_OS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOsName() { + return osName; + } + + + @JsonProperty(JSON_PROPERTY_OS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOsName(String osName) { + this.osName = osName; + } + + + public DeviceInfo osVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * The version of the device operating system. + * @return osVersion + **/ + @ApiModelProperty(value = "The version of the device operating system.") + @JsonProperty(JSON_PROPERTY_OS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOsVersion() { + return osVersion; + } + + + @JsonProperty(JSON_PROPERTY_OS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + + public DeviceInfo paymentTypes(List paymentTypes) { + this.paymentTypes = paymentTypes; + return this; + } + + public DeviceInfo addPaymentTypesItem(String paymentTypesItem) { + if (this.paymentTypes == null) { + this.paymentTypes = new ArrayList<>(); + } + this.paymentTypes.add(paymentTypesItem); + return this; + } + + /** + * Different types of payments supported for the network token. + * @return paymentTypes + **/ + @ApiModelProperty(value = "Different types of payments supported for the network token.") + @JsonProperty(JSON_PROPERTY_PAYMENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPaymentTypes() { + return paymentTypes; + } + + + @JsonProperty(JSON_PROPERTY_PAYMENT_TYPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentTypes(List paymentTypes) { + this.paymentTypes = paymentTypes; + } + + + public DeviceInfo serialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * The serial number of the device. + * @return serialNumber + **/ + @ApiModelProperty(value = "The serial number of the device.") + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSerialNumber() { + return serialNumber; + } + + + @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + + public DeviceInfo storageTechnology(String storageTechnology) { + this.storageTechnology = storageTechnology; + return this; + } + + /** + * The architecture or technology used for network token storage. + * @return storageTechnology + **/ + @ApiModelProperty(value = "The architecture or technology used for network token storage.") + @JsonProperty(JSON_PROPERTY_STORAGE_TECHNOLOGY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStorageTechnology() { + return storageTechnology; + } + + + @JsonProperty(JSON_PROPERTY_STORAGE_TECHNOLOGY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageTechnology(String storageTechnology) { + this.storageTechnology = storageTechnology; + } + + + /** + * Return true if this DeviceInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceInfo deviceInfo = (DeviceInfo) o; + return Objects.equals(this.cardCaptureTechnology, deviceInfo.cardCaptureTechnology) && + Objects.equals(this.deviceName, deviceInfo.deviceName) && + Objects.equals(this.formFactor, deviceInfo.formFactor) && + Objects.equals(this.imei, deviceInfo.imei) && + Objects.equals(this.isoDeviceType, deviceInfo.isoDeviceType) && + Objects.equals(this.msisdn, deviceInfo.msisdn) && + Objects.equals(this.osName, deviceInfo.osName) && + Objects.equals(this.osVersion, deviceInfo.osVersion) && + Objects.equals(this.paymentTypes, deviceInfo.paymentTypes) && + Objects.equals(this.serialNumber, deviceInfo.serialNumber) && + Objects.equals(this.storageTechnology, deviceInfo.storageTechnology); + } + + @Override + public int hashCode() { + return Objects.hash(cardCaptureTechnology, deviceName, formFactor, imei, isoDeviceType, msisdn, osName, osVersion, paymentTypes, serialNumber, storageTechnology); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeviceInfo {\n"); + sb.append(" cardCaptureTechnology: ").append(toIndentedString(cardCaptureTechnology)).append("\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); + sb.append(" imei: ").append(toIndentedString(imei)).append("\n"); + sb.append(" isoDeviceType: ").append(toIndentedString(isoDeviceType)).append("\n"); + sb.append(" msisdn: ").append(toIndentedString(msisdn)).append("\n"); + sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); + sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); + sb.append(" paymentTypes: ").append(toIndentedString(paymentTypes)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" storageTechnology: ").append(toIndentedString(storageTechnology)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of DeviceInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeviceInfo + * @throws JsonProcessingException if the JSON string is invalid with respect to DeviceInfo + */ + public static DeviceInfo fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DeviceInfo.class); + } +/** + * Convert an instance of DeviceInfo to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java b/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java new file mode 100644 index 000000000..73c7a5624 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java @@ -0,0 +1,129 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.adyen.model.balanceplatform.NetworkToken; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * GetNetworkTokenResponse + */ +@JsonPropertyOrder({ + GetNetworkTokenResponse.JSON_PROPERTY_TOKEN +}) + +public class GetNetworkTokenResponse { + public static final String JSON_PROPERTY_TOKEN = "token"; + private NetworkToken token; + + public GetNetworkTokenResponse() { + } + + public GetNetworkTokenResponse token(NetworkToken token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public NetworkToken getToken() { + return token; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToken(NetworkToken token) { + this.token = token; + } + + + /** + * Return true if this GetNetworkTokenResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetNetworkTokenResponse getNetworkTokenResponse = (GetNetworkTokenResponse) o; + return Objects.equals(this.token, getNetworkTokenResponse.token); + } + + @Override + public int hashCode() { + return Objects.hash(token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetNetworkTokenResponse {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of GetNetworkTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetNetworkTokenResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to GetNetworkTokenResponse + */ + public static GetNetworkTokenResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, GetNetworkTokenResponse.class); + } +/** + * Convert an instance of GetNetworkTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java new file mode 100644 index 000000000..7b90ee99d --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java @@ -0,0 +1,223 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * HKLocalAccountIdentification + */ +@JsonPropertyOrder({ + HKLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + HKLocalAccountIdentification.JSON_PROPERTY_BANK_CODE, + HKLocalAccountIdentification.JSON_PROPERTY_TYPE +}) + +public class HKLocalAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; + private String bankCode; + + /** + * **hkLocal** + */ + public enum TypeEnum { + HKLOCAL("hkLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type = TypeEnum.HKLOCAL; + + public HKLocalAccountIdentification() { + } + + public HKLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 6- to 19-character bank account number (alphanumeric), without separators or whitespace.") + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountNumber() { + return accountNumber; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public HKLocalAccountIdentification bankCode(String bankCode) { + this.bankCode = bankCode; + return this; + } + + /** + * The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. + * @return bankCode + **/ + @ApiModelProperty(required = true, value = "The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace.") + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBankCode() { + return bankCode; + } + + + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + + public HKLocalAccountIdentification type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * **hkLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**hkLocal**") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + /** + * 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.bankCode, hkLocalAccountIdentification.bankCode) && + Objects.equals(this.type, hkLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bankCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HKLocalAccountIdentification {\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 "); + } + +/** + * 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/balanceplatform/ListNetworkTokensResponse.java b/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java new file mode 100644 index 000000000..0ecf42779 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java @@ -0,0 +1,139 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.adyen.model.balanceplatform.NetworkToken; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * ListNetworkTokensResponse + */ +@JsonPropertyOrder({ + ListNetworkTokensResponse.JSON_PROPERTY_NETWORK_TOKENS +}) + +public class ListNetworkTokensResponse { + public static final String JSON_PROPERTY_NETWORK_TOKENS = "networkTokens"; + private List networkTokens = null; + + public ListNetworkTokensResponse() { + } + + public ListNetworkTokensResponse networkTokens(List networkTokens) { + this.networkTokens = networkTokens; + return this; + } + + public ListNetworkTokensResponse addNetworkTokensItem(NetworkToken networkTokensItem) { + if (this.networkTokens == null) { + this.networkTokens = new ArrayList<>(); + } + this.networkTokens.add(networkTokensItem); + return this; + } + + /** + * List of network tokens. + * @return networkTokens + **/ + @ApiModelProperty(value = "List of network tokens.") + @JsonProperty(JSON_PROPERTY_NETWORK_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNetworkTokens() { + return networkTokens; + } + + + @JsonProperty(JSON_PROPERTY_NETWORK_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworkTokens(List networkTokens) { + this.networkTokens = networkTokens; + } + + + /** + * Return true if this ListNetworkTokensResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListNetworkTokensResponse listNetworkTokensResponse = (ListNetworkTokensResponse) o; + return Objects.equals(this.networkTokens, listNetworkTokensResponse.networkTokens); + } + + @Override + public int hashCode() { + return Objects.hash(networkTokens); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListNetworkTokensResponse {\n"); + sb.append(" networkTokens: ").append(toIndentedString(networkTokens)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of ListNetworkTokensResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListNetworkTokensResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to ListNetworkTokensResponse + */ + public static ListNetworkTokensResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ListNetworkTokensResponse.class); + } +/** + * Convert an instance of ListNetworkTokensResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java new file mode 100644 index 000000000..3f558732a --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java @@ -0,0 +1,254 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * NZLocalAccountIdentification + */ +@JsonPropertyOrder({ + NZLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_NUMBER, + NZLocalAccountIdentification.JSON_PROPERTY_ACCOUNT_SUFFIX, + NZLocalAccountIdentification.JSON_PROPERTY_BANK_CODE, + NZLocalAccountIdentification.JSON_PROPERTY_TYPE +}) + +public class NZLocalAccountIdentification { + public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; + private String accountNumber; + + public static final String JSON_PROPERTY_ACCOUNT_SUFFIX = "accountSuffix"; + private String accountSuffix; + + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; + private String bankCode; + + /** + * **nzLocal** + */ + public enum TypeEnum { + NZLOCAL("nzLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type = TypeEnum.NZLOCAL; + + public NZLocalAccountIdentification() { + } + + public NZLocalAccountIdentification accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * The 7-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 7-digit bank account number, without separators or whitespace.") + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountNumber() { + return accountNumber; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public NZLocalAccountIdentification accountSuffix(String accountSuffix) { + this.accountSuffix = accountSuffix; + return this; + } + + /** + * The 2- to 3-digit account suffix, without separators or whitespace. + * @return accountSuffix + **/ + @ApiModelProperty(required = true, value = "The 2- to 3-digit account suffix, without separators or whitespace.") + @JsonProperty(JSON_PROPERTY_ACCOUNT_SUFFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountSuffix() { + return accountSuffix; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_SUFFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountSuffix(String accountSuffix) { + this.accountSuffix = accountSuffix; + } + + + public NZLocalAccountIdentification bankCode(String bankCode) { + this.bankCode = bankCode; + return this; + } + + /** + * The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. + * @return bankCode + **/ + @ApiModelProperty(required = true, value = "The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace.") + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBankCode() { + return bankCode; + } + + + @JsonProperty(JSON_PROPERTY_BANK_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + + public NZLocalAccountIdentification type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * **nzLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**nzLocal**") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + /** + * 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.accountSuffix, nzLocalAccountIdentification.accountSuffix) && + Objects.equals(this.bankCode, nzLocalAccountIdentification.bankCode) && + Objects.equals(this.type, nzLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, accountSuffix, bankCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NZLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountSuffix: ").append(toIndentedString(accountSuffix)).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 "); + } + +/** + * 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/balanceplatform/NetworkToken.java b/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java new file mode 100644 index 000000000..91cd9755c --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java @@ -0,0 +1,386 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.adyen.model.balanceplatform.DeviceInfo; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * NetworkToken + */ +@JsonPropertyOrder({ + NetworkToken.JSON_PROPERTY_BRAND_VARIANT, + NetworkToken.JSON_PROPERTY_CREATION_DATE, + NetworkToken.JSON_PROPERTY_DEVICE, + NetworkToken.JSON_PROPERTY_ID, + NetworkToken.JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, + NetworkToken.JSON_PROPERTY_STATUS, + NetworkToken.JSON_PROPERTY_TOKEN_LAST_FOUR, + NetworkToken.JSON_PROPERTY_TYPE +}) + +public class NetworkToken { + public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; + private String brandVariant; + + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; + private OffsetDateTime creationDate; + + public static final String JSON_PROPERTY_DEVICE = "device"; + private DeviceInfo device; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; + private String paymentInstrumentId; + + /** + * The status of the network token. Possible values: **active**, **inactive**, **suspended**, **closed**. + */ + public enum StatusEnum { + ACTIVE("active"), + + INACTIVE("inactive"), + + SUSPENDED("suspended"), + + CLOSED("closed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_TOKEN_LAST_FOUR = "tokenLastFour"; + private String tokenLastFour; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public NetworkToken() { + } + + public NetworkToken brandVariant(String brandVariant) { + this.brandVariant = brandVariant; + return this; + } + + /** + * The card brand variant of the payment instrument associated with the network token. For example, **mc_prepaid_mrw**. + * @return brandVariant + **/ + @ApiModelProperty(value = "The card brand variant of the payment instrument associated with the network token. For example, **mc_prepaid_mrw**.") + @JsonProperty(JSON_PROPERTY_BRAND_VARIANT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBrandVariant() { + return brandVariant; + } + + + @JsonProperty(JSON_PROPERTY_BRAND_VARIANT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBrandVariant(String brandVariant) { + this.brandVariant = brandVariant; + } + + + public NetworkToken creationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * Date and time when the network token was created, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) extended format. For example, **2020-12-18T10:15:30+01:00**.. + * @return creationDate + **/ + @ApiModelProperty(value = "Date and time when the network token was created, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) extended format. For example, **2020-12-18T10:15:30+01:00**..") + @JsonProperty(JSON_PROPERTY_CREATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getCreationDate() { + return creationDate; + } + + + @JsonProperty(JSON_PROPERTY_CREATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + } + + + public NetworkToken device(DeviceInfo device) { + this.device = device; + return this; + } + + /** + * Get device + * @return device + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public DeviceInfo getDevice() { + return device; + } + + + @JsonProperty(JSON_PROPERTY_DEVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDevice(DeviceInfo device) { + this.device = device; + } + + + public NetworkToken id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the network token. + * @return id + **/ + @ApiModelProperty(value = "The unique identifier of the network token.") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public NetworkToken paymentInstrumentId(String paymentInstrumentId) { + this.paymentInstrumentId = paymentInstrumentId; + return this; + } + + /** + * The unique identifier of the payment instrument to which this network token belongs to. + * @return paymentInstrumentId + **/ + @ApiModelProperty(value = "The unique identifier of the payment instrument to which this network token belongs to.") + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPaymentInstrumentId() { + return paymentInstrumentId; + } + + + @JsonProperty(JSON_PROPERTY_PAYMENT_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentInstrumentId(String paymentInstrumentId) { + this.paymentInstrumentId = paymentInstrumentId; + } + + + public NetworkToken status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the network token. Possible values: **active**, **inactive**, **suspended**, **closed**. + * @return status + **/ + @ApiModelProperty(value = "The status of the network token. Possible values: **active**, **inactive**, **suspended**, **closed**.") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public NetworkToken tokenLastFour(String tokenLastFour) { + this.tokenLastFour = tokenLastFour; + return this; + } + + /** + * The last four digits of the network token `id`. + * @return tokenLastFour + **/ + @ApiModelProperty(value = "The last four digits of the network token `id`.") + @JsonProperty(JSON_PROPERTY_TOKEN_LAST_FOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTokenLastFour() { + return tokenLastFour; + } + + + @JsonProperty(JSON_PROPERTY_TOKEN_LAST_FOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenLastFour(String tokenLastFour) { + this.tokenLastFour = tokenLastFour; + } + + + public NetworkToken type(String type) { + this.type = type; + return this; + } + + /** + * The type of wallet the network token is associated with. For example, **applePay**. + * @return type + **/ + @ApiModelProperty(value = "The type of wallet the network token is associated with. For example, **applePay**.") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + + /** + * Return true if this NetworkToken object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkToken networkToken = (NetworkToken) o; + return Objects.equals(this.brandVariant, networkToken.brandVariant) && + Objects.equals(this.creationDate, networkToken.creationDate) && + Objects.equals(this.device, networkToken.device) && + Objects.equals(this.id, networkToken.id) && + Objects.equals(this.paymentInstrumentId, networkToken.paymentInstrumentId) && + Objects.equals(this.status, networkToken.status) && + Objects.equals(this.tokenLastFour, networkToken.tokenLastFour) && + Objects.equals(this.type, networkToken.type); + } + + @Override + public int hashCode() { + return Objects.hash(brandVariant, creationDate, device, id, paymentInstrumentId, status, tokenLastFour, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkToken {\n"); + sb.append(" brandVariant: ").append(toIndentedString(brandVariant)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" device: ").append(toIndentedString(device)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" paymentInstrumentId: ").append(toIndentedString(paymentInstrumentId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tokenLastFour: ").append(toIndentedString(tokenLastFour)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of NetworkToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkToken + * @throws JsonProcessingException if the JSON string is invalid with respect to NetworkToken + */ + public static NetworkToken fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, NetworkToken.class); + } +/** + * Convert an instance of NetworkToken to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java new file mode 100644 index 000000000..b76d6314d --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java @@ -0,0 +1,159 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * PlatformPaymentConfiguration + */ +@JsonPropertyOrder({ + PlatformPaymentConfiguration.JSON_PROPERTY_SALES_DAY_CLOSING_TIME, + PlatformPaymentConfiguration.JSON_PROPERTY_SETTLEMENT_DELAY_DAYS +}) + +public class PlatformPaymentConfiguration { + public static final String JSON_PROPERTY_SALES_DAY_CLOSING_TIME = "salesDayClosingTime"; + private String salesDayClosingTime; + + public static final String JSON_PROPERTY_SETTLEMENT_DELAY_DAYS = "settlementDelayDays"; + private Integer settlementDelayDays; + + public PlatformPaymentConfiguration() { + } + + public PlatformPaymentConfiguration salesDayClosingTime(String salesDayClosingTime) { + this.salesDayClosingTime = salesDayClosingTime; + return this; + } + + /** + * Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**. + * @return salesDayClosingTime + **/ + @ApiModelProperty(value = "Specifies at what time a [sales day](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#sales-day) ends. Possible values: Time in **\"HH:MM\"** format. **HH** ranges from **00** to **07**. **MM** must be **00**. Default value: **\"00:00\"**.") + @JsonProperty(JSON_PROPERTY_SALES_DAY_CLOSING_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSalesDayClosingTime() { + return salesDayClosingTime; + } + + + @JsonProperty(JSON_PROPERTY_SALES_DAY_CLOSING_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSalesDayClosingTime(String salesDayClosingTime) { + this.salesDayClosingTime = salesDayClosingTime; + } + + + public PlatformPaymentConfiguration settlementDelayDays(Integer settlementDelayDays) { + this.settlementDelayDays = settlementDelayDays; + return this; + } + + /** + * Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**. + * @return settlementDelayDays + **/ + @ApiModelProperty(value = "Specifies after how many business days the funds in a [settlement batch](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement#settlement-batch) are made available. Possible values: **0** to **10**, or **null**. * Setting this value to an integer enables [Sales day settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/sales-day-settlement). * Setting this value to **null** enables [Pass-through settlement](https://docs.adyen.com/marketplaces-and-platforms/receive-funds/pass-through-settlement). Default value: **null**.") + @JsonProperty(JSON_PROPERTY_SETTLEMENT_DELAY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSettlementDelayDays() { + return settlementDelayDays; + } + + + @JsonProperty(JSON_PROPERTY_SETTLEMENT_DELAY_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSettlementDelayDays(Integer settlementDelayDays) { + this.settlementDelayDays = settlementDelayDays; + } + + + /** + * Return true if this PlatformPaymentConfiguration object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPaymentConfiguration platformPaymentConfiguration = (PlatformPaymentConfiguration) o; + return Objects.equals(this.salesDayClosingTime, platformPaymentConfiguration.salesDayClosingTime) && + Objects.equals(this.settlementDelayDays, platformPaymentConfiguration.settlementDelayDays); + } + + @Override + public int hashCode() { + return Objects.hash(salesDayClosingTime, settlementDelayDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlatformPaymentConfiguration {\n"); + sb.append(" salesDayClosingTime: ").append(toIndentedString(salesDayClosingTime)).append("\n"); + sb.append(" settlementDelayDays: ").append(toIndentedString(settlementDelayDays)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of PlatformPaymentConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of PlatformPaymentConfiguration + * @throws JsonProcessingException if the JSON string is invalid with respect to PlatformPaymentConfiguration + */ + public static PlatformPaymentConfiguration fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PlatformPaymentConfiguration.class); + } +/** + * Convert an instance of PlatformPaymentConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java index cb3977cdc..f823b6f08 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java @@ -17,8 +17,8 @@ import java.util.Map; import java.util.HashMap; import com.adyen.model.balanceplatform.Amount; -import com.adyen.model.balanceplatform.SweepConfigurationV2Schedule; import com.adyen.model.balanceplatform.SweepCounterparty; +import com.adyen.model.balanceplatform.SweepSchedule; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -213,7 +213,7 @@ public static ReasonEnum fromValue(String value) { private ReasonEnum reason; public static final String JSON_PROPERTY_SCHEDULE = "schedule"; - private SweepConfigurationV2Schedule schedule; + private SweepSchedule schedule; /** * The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. @@ -486,7 +486,7 @@ public void setReason(ReasonEnum reason) { } - public SweepConfigurationV2 schedule(SweepConfigurationV2Schedule schedule) { + public SweepConfigurationV2 schedule(SweepSchedule schedule) { this.schedule = schedule; return this; } @@ -499,14 +499,14 @@ public SweepConfigurationV2 schedule(SweepConfigurationV2Schedule schedule) { @JsonProperty(JSON_PROPERTY_SCHEDULE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SweepConfigurationV2Schedule getSchedule() { + public SweepSchedule getSchedule() { return schedule; } @JsonProperty(JSON_PROPERTY_SCHEDULE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSchedule(SweepConfigurationV2Schedule schedule) { + public void setSchedule(SweepSchedule schedule) { this.schedule = schedule; } diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java deleted file mode 100644 index 73918eff9..000000000 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Configuration API - * - * The version of the OpenAPI document: 2 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.model.balanceplatform; - -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.adyen.model.balanceplatform.CronSweepSchedule; -import com.adyen.model.balanceplatform.SweepSchedule; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.core.JsonProcessingException; - -import com.fasterxml.jackson.core.type.TypeReference; - -import jakarta.ws.rs.core.GenericType; -import jakarta.ws.rs.core.Response; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - - -@JsonDeserialize(using = SweepConfigurationV2Schedule.SweepConfigurationV2ScheduleDeserializer.class) -@JsonSerialize(using = SweepConfigurationV2Schedule.SweepConfigurationV2ScheduleSerializer.class) -public class SweepConfigurationV2Schedule extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(SweepConfigurationV2Schedule.class.getName()); - - public static class SweepConfigurationV2ScheduleSerializer extends StdSerializer { - public SweepConfigurationV2ScheduleSerializer(Class t) { - super(t); - } - - public SweepConfigurationV2ScheduleSerializer() { - this(null); - } - - @Override - public void serialize(SweepConfigurationV2Schedule value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { - jgen.writeObject(value.getActualInstance()); - } - } - - public static class SweepConfigurationV2ScheduleDeserializer extends StdDeserializer { - public SweepConfigurationV2ScheduleDeserializer() { - this(SweepConfigurationV2Schedule.class); - } - - public SweepConfigurationV2ScheduleDeserializer(Class vc) { - super(vc); - } - - @Override - public SweepConfigurationV2Schedule deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { - JsonNode tree = jp.readValueAsTree(); - Object deserialized = null; - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); - int match = 0; - JsonToken token = tree.traverse(jp.getCodec()).nextToken(); - // Local Object Mapper that forces strict validation - ObjectMapper localObjectMapper = JSON.getMapper(); - localObjectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); - - // deserialize CronSweepSchedule - try { - boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if (CronSweepSchedule.class.equals(Integer.class) || CronSweepSchedule.class.equals(Long.class) || CronSweepSchedule.class.equals(Float.class) || CronSweepSchedule.class.equals(Double.class) || CronSweepSchedule.class.equals(Boolean.class) || CronSweepSchedule.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= ((CronSweepSchedule.class.equals(Integer.class) || CronSweepSchedule.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((CronSweepSchedule.class.equals(Float.class) || CronSweepSchedule.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (CronSweepSchedule.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (CronSweepSchedule.class.equals(String.class) && token == JsonToken.VALUE_STRING); - } - } - // Checks if the unique type of the oneOf json matches any of the object TypeEnum values - boolean typeMatch = Arrays.stream(CronSweepSchedule.TypeEnum.values()).anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText())); - if (attemptParsing || typeMatch) { - // Strict deserialization for oneOf models - deserialized = localObjectMapper.readValue(tree.toString(), CronSweepSchedule.class); - // typeMatch should enforce proper deserialization - match++; - log.log(Level.FINER, "Input data matches schema 'CronSweepSchedule'"); - } - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'CronSweepSchedule'", e); - } - - - // deserialize SweepSchedule - try { - boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if (SweepSchedule.class.equals(Integer.class) || SweepSchedule.class.equals(Long.class) || SweepSchedule.class.equals(Float.class) || SweepSchedule.class.equals(Double.class) || SweepSchedule.class.equals(Boolean.class) || SweepSchedule.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= ((SweepSchedule.class.equals(Integer.class) || SweepSchedule.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((SweepSchedule.class.equals(Float.class) || SweepSchedule.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (SweepSchedule.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (SweepSchedule.class.equals(String.class) && token == JsonToken.VALUE_STRING); - } - } - // Checks if the unique type of the oneOf json matches any of the object TypeEnum values - boolean typeMatch = Arrays.stream(SweepSchedule.TypeEnum.values()).anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText())); - if (attemptParsing || typeMatch) { - // Strict deserialization for oneOf models - deserialized = localObjectMapper.readValue(tree.toString(), SweepSchedule.class); - // typeMatch should enforce proper deserialization - match++; - log.log(Level.FINER, "Input data matches schema 'SweepSchedule'"); - } - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'SweepSchedule'", e); - } - - // Throw error if there is no match - if (match == 0) { - throw new IOException(String.format("Failed deserialization for SweepConfigurationV2Schedule: %d classes match result, expected 1", match)); - } - // Log warning if there is more than one match - if (match > 1) { - log.log(Level.WARNING, String.format("Warning, indecisive deserialization for SweepConfigurationV2Schedule: %d classes match result, expected 1", match)); - } - - localObjectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - SweepConfigurationV2Schedule ret = new SweepConfigurationV2Schedule(); - ret.setActualInstance(deserialized); - return ret; - } - - /** - * Handle deserialization of the 'null' value. - */ - @Override - public SweepConfigurationV2Schedule getNullValue(DeserializationContext ctxt) throws JsonMappingException { - throw new JsonMappingException(ctxt.getParser(), "SweepConfigurationV2Schedule cannot be null"); - } - } - - // store a list of schema names defined in oneOf - public static final Map schemas = new HashMap(); - - public SweepConfigurationV2Schedule() { - super("oneOf", Boolean.FALSE); - } - - public SweepConfigurationV2Schedule(CronSweepSchedule o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public SweepConfigurationV2Schedule(SweepSchedule o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("CronSweepSchedule", new GenericType() { - }); - schemas.put("SweepSchedule", new GenericType() { - }); - JSON.registerDescendants(SweepConfigurationV2Schedule.class, Collections.unmodifiableMap(schemas)); - } - - @Override - public Map getSchemas() { - return SweepConfigurationV2Schedule.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * CronSweepSchedule, SweepSchedule - * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). - */ - @Override - public void setActualInstance(Object instance) { - if (JSON.isInstanceOf(CronSweepSchedule.class, instance, new HashSet>())) { - super.setActualInstance(instance); - return; - } - - if (JSON.isInstanceOf(SweepSchedule.class, instance, new HashSet>())) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be CronSweepSchedule, SweepSchedule"); - } - - /** - * Get the actual instance, which can be the following: - * CronSweepSchedule, SweepSchedule - * - * @return The actual instance (CronSweepSchedule, SweepSchedule) - */ - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `CronSweepSchedule`. If the actual instance is not `CronSweepSchedule`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `CronSweepSchedule` - * @throws ClassCastException if the instance is not `CronSweepSchedule` - */ - public CronSweepSchedule getCronSweepSchedule() throws ClassCastException { - return (CronSweepSchedule)super.getActualInstance(); - } - - /** - * Get the actual instance of `SweepSchedule`. If the actual instance is not `SweepSchedule`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `SweepSchedule` - * @throws ClassCastException if the instance is not `SweepSchedule` - */ - public SweepSchedule getSweepSchedule() throws ClassCastException { - return (SweepSchedule)super.getActualInstance(); - } - -} - diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java index 7b7bab35c..70c777043 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java @@ -31,12 +31,16 @@ * SweepSchedule */ @JsonPropertyOrder({ + SweepSchedule.JSON_PROPERTY_CRON_EXPRESSION, SweepSchedule.JSON_PROPERTY_TYPE }) public class SweepSchedule { + public static final String JSON_PROPERTY_CRON_EXPRESSION = "cronExpression"; + private String cronExpression; + /** - * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + * The schedule type. Possible values: * **cron**: push out funds based on a `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. */ public enum TypeEnum { DAILY("daily"), @@ -82,16 +86,41 @@ public static TypeEnum fromValue(String value) { public SweepSchedule() { } + public SweepSchedule cronExpression(String cronExpression) { + this.cronExpression = cronExpression; + return this; + } + + /** + * A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: **&ast;**, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. Required when `type` is **cron**. + * @return cronExpression + **/ + @ApiModelProperty(value = "A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. Required when `type` is **cron**. ") + @JsonProperty(JSON_PROPERTY_CRON_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCronExpression() { + return cronExpression; + } + + + @JsonProperty(JSON_PROPERTY_CRON_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCronExpression(String cronExpression) { + this.cronExpression = cronExpression; + } + + public SweepSchedule type(TypeEnum type) { this.type = type; return this; } /** - * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. + * The schedule type. Possible values: * **cron**: push out funds based on a `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. * @return type **/ - @ApiModelProperty(value = "The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction.") + @ApiModelProperty(required = true, value = "The schedule type. Possible values: * **cron**: push out funds based on a `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. ") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -119,18 +148,20 @@ public boolean equals(Object o) { return false; } SweepSchedule sweepSchedule = (SweepSchedule) o; - return Objects.equals(this.type, sweepSchedule.type); + return Objects.equals(this.cronExpression, sweepSchedule.cronExpression) && + Objects.equals(this.type, sweepSchedule.type); } @Override public int hashCode() { - return Objects.hash(type); + return Objects.hash(cronExpression, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SweepSchedule {\n"); + sb.append(" cronExpression: ").append(toIndentedString(cronExpression)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java index c3d579f6f..6d18e6f27 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java @@ -118,6 +118,8 @@ public enum RequestTypeEnum { AUTHORIZATION("authorization"), + BANKTRANSFER("bankTransfer"), + TOKENIZATION("tokenization"); private String value; diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java index d73a7451a..164460b1b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java @@ -114,6 +114,8 @@ public enum RequestTypeEnum { AUTHORIZATION("authorization"), + BANKTRANSFER("bankTransfer"), + TOKENIZATION("tokenization"); private String value; diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java b/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java new file mode 100644 index 000000000..e03021085 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java @@ -0,0 +1,165 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * UpdateNetworkTokenRequest + */ +@JsonPropertyOrder({ + UpdateNetworkTokenRequest.JSON_PROPERTY_STATUS +}) + +public class UpdateNetworkTokenRequest { + /** + * The new status of the network token. Possible values: **active**, **suspended**, **closed**. The **closed** status is final and cannot be changed. + */ + public enum StatusEnum { + ACTIVE("active"), + + SUSPENDED("suspended"), + + CLOSED("closed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public UpdateNetworkTokenRequest() { + } + + public UpdateNetworkTokenRequest status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * The new status of the network token. Possible values: **active**, **suspended**, **closed**. The **closed** status is final and cannot be changed. + * @return status + **/ + @ApiModelProperty(value = "The new status of the network token. Possible values: **active**, **suspended**, **closed**. The **closed** status is final and cannot be changed.") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + /** + * Return true if this UpdateNetworkTokenRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateNetworkTokenRequest updateNetworkTokenRequest = (UpdateNetworkTokenRequest) o; + return Objects.equals(this.status, updateNetworkTokenRequest.status); + } + + @Override + public int hashCode() { + return Objects.hash(status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateNetworkTokenRequest {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of UpdateNetworkTokenRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateNetworkTokenRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to UpdateNetworkTokenRequest + */ + public static UpdateNetworkTokenRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, UpdateNetworkTokenRequest.class); + } +/** + * Convert an instance of UpdateNetworkTokenRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java new file mode 100644 index 000000000..4d9312b78 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java @@ -0,0 +1,784 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.adyen.model.balanceplatform.Amount; +import com.adyen.model.balanceplatform.SweepCounterparty; +import com.adyen.model.balanceplatform.SweepSchedule; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; + + +/** + * UpdateSweepConfigurationV2 + */ +@JsonPropertyOrder({ + UpdateSweepConfigurationV2.JSON_PROPERTY_BALANCE_ACCOUNT_ID, + UpdateSweepConfigurationV2.JSON_PROPERTY_CATEGORY, + UpdateSweepConfigurationV2.JSON_PROPERTY_COUNTERPARTY, + UpdateSweepConfigurationV2.JSON_PROPERTY_CURRENCY, + UpdateSweepConfigurationV2.JSON_PROPERTY_DESCRIPTION, + UpdateSweepConfigurationV2.JSON_PROPERTY_ID, + UpdateSweepConfigurationV2.JSON_PROPERTY_PRIORITIES, + UpdateSweepConfigurationV2.JSON_PROPERTY_REASON, + UpdateSweepConfigurationV2.JSON_PROPERTY_SCHEDULE, + UpdateSweepConfigurationV2.JSON_PROPERTY_STATUS, + UpdateSweepConfigurationV2.JSON_PROPERTY_SWEEP_AMOUNT, + UpdateSweepConfigurationV2.JSON_PROPERTY_TARGET_AMOUNT, + UpdateSweepConfigurationV2.JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, + UpdateSweepConfigurationV2.JSON_PROPERTY_TRIGGER_AMOUNT, + UpdateSweepConfigurationV2.JSON_PROPERTY_TYPE +}) + +public class UpdateSweepConfigurationV2 { + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; + private String balanceAccountId; + + /** + * The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + */ + public enum CategoryEnum { + BANK("bank"), + + INTERNAL("internal"), + + PLATFORMPAYMENT("platformPayment"); + + private String value; + + CategoryEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CategoryEnum fromValue(String value) { + for (CategoryEnum b : CategoryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private CategoryEnum category; + + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; + private SweepCounterparty counterparty; + + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** + * Gets or Sets priorities + */ + public enum PrioritiesEnum { + CROSSBORDER("crossBorder"), + + DIRECTDEBIT("directDebit"), + + FAST("fast"), + + INSTANT("instant"), + + INTERNAL("internal"), + + REGULAR("regular"), + + WIRE("wire"); + + private String value; + + PrioritiesEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PrioritiesEnum fromValue(String value) { + for (PrioritiesEnum b : PrioritiesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PRIORITIES = "priorities"; + private List priorities = null; + + /** + * The reason for disabling the sweep. + */ + public enum ReasonEnum { + AMOUNTLIMITEXCEEDED("amountLimitExceeded"), + + APPROVED("approved"), + + COUNTERPARTYACCOUNTBLOCKED("counterpartyAccountBlocked"), + + COUNTERPARTYACCOUNTCLOSED("counterpartyAccountClosed"), + + COUNTERPARTYACCOUNTNOTFOUND("counterpartyAccountNotFound"), + + COUNTERPARTYADDRESSREQUIRED("counterpartyAddressRequired"), + + COUNTERPARTYBANKTIMEDOUT("counterpartyBankTimedOut"), + + COUNTERPARTYBANKUNAVAILABLE("counterpartyBankUnavailable"), + + ERROR("error"), + + NOTENOUGHBALANCE("notEnoughBalance"), + + REFUSEDBYCOUNTERPARTYBANK("refusedByCounterpartyBank"), + + ROUTENOTFOUND("routeNotFound"), + + UNKNOWN("unknown"); + + private String value; + + ReasonEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ReasonEnum fromValue(String value) { + for (ReasonEnum b : ReasonEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_REASON = "reason"; + private ReasonEnum reason; + + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; + private SweepSchedule schedule; + + /** + * The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + */ + public enum StatusEnum { + ACTIVE("active"), + + INACTIVE("inactive"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_SWEEP_AMOUNT = "sweepAmount"; + private Amount sweepAmount; + + public static final String JSON_PROPERTY_TARGET_AMOUNT = "targetAmount"; + private Amount targetAmount; + + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + private String transferInstrumentId; + + public static final String JSON_PROPERTY_TRIGGER_AMOUNT = "triggerAmount"; + private Amount triggerAmount; + + /** + * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + */ + public enum TypeEnum { + PULL("pull"), + + PUSH("push"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type = TypeEnum.PUSH; + + public UpdateSweepConfigurationV2() { + } + + public UpdateSweepConfigurationV2 balanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + return this; + } + + /** + * The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. + * @return balanceAccountId + **/ + @ApiModelProperty(value = "The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**.") + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBalanceAccountId() { + return balanceAccountId; + } + + + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + } + + + public UpdateSweepConfigurationV2 category(CategoryEnum category) { + this.category = category; + return this; + } + + /** + * The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + * @return category + **/ + @ApiModelProperty(value = "The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`.") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CategoryEnum getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(CategoryEnum category) { + this.category = category; + } + + + public UpdateSweepConfigurationV2 counterparty(SweepCounterparty counterparty) { + this.counterparty = counterparty; + return this; + } + + /** + * Get counterparty + * @return counterparty + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SweepCounterparty getCounterparty() { + return counterparty; + } + + + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCounterparty(SweepCounterparty counterparty) { + this.counterparty = counterparty; + } + + + public UpdateSweepConfigurationV2 currency(String currency) { + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + * @return currency + **/ + @ApiModelProperty(value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances).") + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCurrency() { + return currency; + } + + + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + } + + + public UpdateSweepConfigurationV2 description(String description) { + this.description = description; + return this; + } + + /** + * The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + * @return description + **/ + @ApiModelProperty(value = "The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters.") + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + + public UpdateSweepConfigurationV2 id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the sweep. + * @return id + **/ + @ApiModelProperty(value = "The unique identifier of the sweep.") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + + public UpdateSweepConfigurationV2 priorities(List priorities) { + this.priorities = priorities; + return this; + } + + public UpdateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesItem) { + if (this.priorities == null) { + this.priorities = new ArrayList<>(); + } + this.priorities.add(prioritiesItem); + return this; + } + + /** + * The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @return priorities + **/ + @ApiModelProperty(value = "The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup).") + @JsonProperty(JSON_PROPERTY_PRIORITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPriorities() { + return priorities; + } + + + @JsonProperty(JSON_PROPERTY_PRIORITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPriorities(List priorities) { + this.priorities = priorities; + } + + + public UpdateSweepConfigurationV2 reason(ReasonEnum reason) { + this.reason = reason; + return this; + } + + /** + * The reason for disabling the sweep. + * @return reason + **/ + @ApiModelProperty(value = "The reason for disabling the sweep.") + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ReasonEnum getReason() { + return reason; + } + + + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReason(ReasonEnum reason) { + this.reason = reason; + } + + + public UpdateSweepConfigurationV2 schedule(SweepSchedule schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get schedule + * @return schedule + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SCHEDULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SweepSchedule getSchedule() { + return schedule; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchedule(SweepSchedule schedule) { + this.schedule = schedule; + } + + + public UpdateSweepConfigurationV2 status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + * @return status + **/ + @ApiModelProperty(value = "The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. ") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public UpdateSweepConfigurationV2 sweepAmount(Amount sweepAmount) { + this.sweepAmount = sweepAmount; + return this; + } + + /** + * Get sweepAmount + * @return sweepAmount + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SWEEP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Amount getSweepAmount() { + return sweepAmount; + } + + + @JsonProperty(JSON_PROPERTY_SWEEP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSweepAmount(Amount sweepAmount) { + this.sweepAmount = sweepAmount; + } + + + public UpdateSweepConfigurationV2 targetAmount(Amount targetAmount) { + this.targetAmount = targetAmount; + return this; + } + + /** + * Get targetAmount + * @return targetAmount + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TARGET_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Amount getTargetAmount() { + return targetAmount; + } + + + @JsonProperty(JSON_PROPERTY_TARGET_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTargetAmount(Amount targetAmount) { + this.targetAmount = targetAmount; + } + + + public UpdateSweepConfigurationV2 transferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + return this; + } + + /** + * The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + * @return transferInstrumentId + **/ + @ApiModelProperty(value = "The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact.") + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTransferInstrumentId() { + return transferInstrumentId; + } + + + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + } + + + public UpdateSweepConfigurationV2 triggerAmount(Amount triggerAmount) { + this.triggerAmount = triggerAmount; + return this; + } + + /** + * Get triggerAmount + * @return triggerAmount + **/ + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TRIGGER_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Amount getTriggerAmount() { + return triggerAmount; + } + + + @JsonProperty(JSON_PROPERTY_TRIGGER_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTriggerAmount(Amount triggerAmount) { + this.triggerAmount = triggerAmount; + } + + + public UpdateSweepConfigurationV2 type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + * @return type + **/ + @ApiModelProperty(value = "The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account.") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + + /** + * Return true if this UpdateSweepConfigurationV2 object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSweepConfigurationV2 updateSweepConfigurationV2 = (UpdateSweepConfigurationV2) o; + return Objects.equals(this.balanceAccountId, updateSweepConfigurationV2.balanceAccountId) && + Objects.equals(this.category, updateSweepConfigurationV2.category) && + Objects.equals(this.counterparty, updateSweepConfigurationV2.counterparty) && + Objects.equals(this.currency, updateSweepConfigurationV2.currency) && + Objects.equals(this.description, updateSweepConfigurationV2.description) && + Objects.equals(this.id, updateSweepConfigurationV2.id) && + Objects.equals(this.priorities, updateSweepConfigurationV2.priorities) && + Objects.equals(this.reason, updateSweepConfigurationV2.reason) && + Objects.equals(this.schedule, updateSweepConfigurationV2.schedule) && + Objects.equals(this.status, updateSweepConfigurationV2.status) && + Objects.equals(this.sweepAmount, updateSweepConfigurationV2.sweepAmount) && + Objects.equals(this.targetAmount, updateSweepConfigurationV2.targetAmount) && + Objects.equals(this.transferInstrumentId, updateSweepConfigurationV2.transferInstrumentId) && + Objects.equals(this.triggerAmount, updateSweepConfigurationV2.triggerAmount) && + Objects.equals(this.type, updateSweepConfigurationV2.type); + } + + @Override + public int hashCode() { + return Objects.hash(balanceAccountId, category, counterparty, currency, description, id, priorities, reason, schedule, status, sweepAmount, targetAmount, transferInstrumentId, triggerAmount, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSweepConfigurationV2 {\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" priorities: ").append(toIndentedString(priorities)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sweepAmount: ").append(toIndentedString(sweepAmount)).append("\n"); + sb.append(" targetAmount: ").append(toIndentedString(targetAmount)).append("\n"); + sb.append(" transferInstrumentId: ").append(toIndentedString(transferInstrumentId)).append("\n"); + sb.append(" triggerAmount: ").append(toIndentedString(triggerAmount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +/** + * Create an instance of UpdateSweepConfigurationV2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSweepConfigurationV2 + * @throws JsonProcessingException if the JSON string is invalid with respect to UpdateSweepConfigurationV2 + */ + public static UpdateSweepConfigurationV2 fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, UpdateSweepConfigurationV2.class); + } +/** + * Convert an instance of UpdateSweepConfigurationV2 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/service/balanceplatform/AccountHoldersApi.java b/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java index 588af92ff..9fb450d70 100644 --- a/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java @@ -16,6 +16,7 @@ import com.adyen.constants.ApiConstants; import com.adyen.model.balanceplatform.AccountHolder; import com.adyen.model.balanceplatform.AccountHolderInfo; +import com.adyen.model.balanceplatform.AccountHolderUpdateRequest; import com.adyen.model.balanceplatform.PaginatedBalanceAccountsResponse; import com.adyen.model.balanceplatform.RestServiceError; import com.adyen.model.RequestOptions; @@ -114,24 +115,24 @@ public PaginatedBalanceAccountsResponse getAllBalanceAccountsOfAccountHolder(Str * Update an account holder * * @param id {@link String } The unique identifier of the account holder. (required) - * @param accountHolder {@link AccountHolder } (required) + * @param accountHolderUpdateRequest {@link AccountHolderUpdateRequest } (required) * @return {@link AccountHolder } * @throws ApiException if fails to make API call */ - public AccountHolder updateAccountHolder(String id, AccountHolder accountHolder) throws ApiException, IOException { - return updateAccountHolder(id, accountHolder, null); + public AccountHolder updateAccountHolder(String id, AccountHolderUpdateRequest accountHolderUpdateRequest) throws ApiException, IOException { + return updateAccountHolder(id, accountHolderUpdateRequest, null); } /** * Update an account holder * * @param id {@link String } The unique identifier of the account holder. (required) - * @param accountHolder {@link AccountHolder } (required) + * @param accountHolderUpdateRequest {@link AccountHolderUpdateRequest } (required) * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) * @return {@link AccountHolder } * @throws ApiException if fails to make API call */ - public AccountHolder updateAccountHolder(String id, AccountHolder accountHolder, RequestOptions requestOptions) throws ApiException, IOException { + public AccountHolder updateAccountHolder(String id, AccountHolderUpdateRequest accountHolderUpdateRequest, RequestOptions requestOptions) throws ApiException, IOException { //Add path params Map pathParams = new HashMap<>(); if (id == null) { @@ -139,7 +140,7 @@ public AccountHolder updateAccountHolder(String id, AccountHolder accountHolder, } pathParams.put("id", id); - String requestBody = accountHolder.toJson(); + String requestBody = accountHolderUpdateRequest.toJson(); Resource resource = new Resource(this, this.baseURL + "/accountHolders/{id}", null); String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); return AccountHolder.fromJson(jsonResult); diff --git a/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java b/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java index 1ed676eac..5eaa0c13f 100644 --- a/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java @@ -21,6 +21,7 @@ import com.adyen.model.balanceplatform.PaginatedPaymentInstrumentsResponse; import com.adyen.model.balanceplatform.RestServiceError; import com.adyen.model.balanceplatform.SweepConfigurationV2; +import com.adyen.model.balanceplatform.UpdateSweepConfigurationV2; import com.adyen.model.RequestOptions; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.Resource; @@ -236,12 +237,12 @@ public PaginatedPaymentInstrumentsResponse getAllPaymentInstrumentsForBalanceAcc * * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) * @param sweepId {@link String } The unique identifier of the sweep. (required) - * @param sweepConfigurationV2 {@link SweepConfigurationV2 } (required) + * @param updateSweepConfigurationV2 {@link UpdateSweepConfigurationV2 } (required) * @return {@link SweepConfigurationV2 } * @throws ApiException if fails to make API call */ - public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, SweepConfigurationV2 sweepConfigurationV2) throws ApiException, IOException { - return updateSweep(balanceAccountId, sweepId, sweepConfigurationV2, null); + public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, UpdateSweepConfigurationV2 updateSweepConfigurationV2) throws ApiException, IOException { + return updateSweep(balanceAccountId, sweepId, updateSweepConfigurationV2, null); } /** @@ -249,12 +250,12 @@ public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, * * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) * @param sweepId {@link String } The unique identifier of the sweep. (required) - * @param sweepConfigurationV2 {@link SweepConfigurationV2 } (required) + * @param updateSweepConfigurationV2 {@link UpdateSweepConfigurationV2 } (required) * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) * @return {@link SweepConfigurationV2 } * @throws ApiException if fails to make API call */ - public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, SweepConfigurationV2 sweepConfigurationV2, RequestOptions requestOptions) throws ApiException, IOException { + public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, UpdateSweepConfigurationV2 updateSweepConfigurationV2, RequestOptions requestOptions) throws ApiException, IOException { //Add path params Map pathParams = new HashMap<>(); if (balanceAccountId == null) { @@ -266,7 +267,7 @@ public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, } pathParams.put("sweepId", sweepId); - String requestBody = sweepConfigurationV2.toJson(); + String requestBody = updateSweepConfigurationV2.toJson(); Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", null); String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); return SweepConfigurationV2.fromJson(jsonResult); diff --git a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java index 2037f4184..640b7fedf 100644 --- a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java @@ -53,6 +53,6 @@ public void validateBankAccountIdentification(BankAccountIdentificationValidatio String requestBody = bankAccountIdentificationValidationRequest.toJson(); Resource resource = new Resource(this, this.baseURL + "/validateBankAccountIdentification", null); - resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + resource.request(requestBody, null, ApiConstants.HttpMethod.POST, null); } } diff --git a/src/main/java/com/adyen/service/balanceplatform/NetworkTokensApi.java b/src/main/java/com/adyen/service/balanceplatform/NetworkTokensApi.java new file mode 100644 index 000000000..c45789a92 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/NetworkTokensApi.java @@ -0,0 +1,100 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.GetNetworkTokenResponse; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.balanceplatform.UpdateNetworkTokenRequest; +import com.adyen.model.RequestOptions; +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 NetworkTokensApi extends Service { + protected String baseURL; + + public NetworkTokensApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a network token + * + * @param networkTokenId {@link String } The unique identifier of the network token. (required) + * @return {@link GetNetworkTokenResponse } + * @throws ApiException if fails to make API call + */ + public GetNetworkTokenResponse getNetworkToken(String networkTokenId) throws ApiException, IOException { + return getNetworkToken(networkTokenId, null); + } + + /** + * Get a network token + * + * @param networkTokenId {@link String } The unique identifier of the network token. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GetNetworkTokenResponse } + * @throws ApiException if fails to make API call + */ + public GetNetworkTokenResponse getNetworkToken(String networkTokenId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (networkTokenId == null) { + throw new IllegalArgumentException("Please provide the networkTokenId path parameter"); + } + pathParams.put("networkTokenId", networkTokenId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/networkTokens/{networkTokenId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return GetNetworkTokenResponse.fromJson(jsonResult); + } + + /** + * Update a network token + * + * @param networkTokenId {@link String } The unique identifier of the network token. (required) + * @param updateNetworkTokenRequest {@link UpdateNetworkTokenRequest } (required) + * @throws ApiException if fails to make API call + */ + public void updateNetworkToken(String networkTokenId, UpdateNetworkTokenRequest updateNetworkTokenRequest) throws ApiException, IOException { + updateNetworkToken(networkTokenId, updateNetworkTokenRequest, null); + } + + /** + * Update a network token + * + * @param networkTokenId {@link String } The unique identifier of the network token. (required) + * @param updateNetworkTokenRequest {@link UpdateNetworkTokenRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void updateNetworkToken(String networkTokenId, UpdateNetworkTokenRequest updateNetworkTokenRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (networkTokenId == null) { + throw new IllegalArgumentException("Please provide the networkTokenId path parameter"); + } + pathParams.put("networkTokenId", networkTokenId); + + String requestBody = updateNetworkTokenRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/networkTokens/{networkTokenId}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java index 0f72d0504..44ea89dab 100644 --- a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java @@ -14,6 +14,7 @@ import com.adyen.Client; import com.adyen.Service; import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.ListNetworkTokensResponse; import com.adyen.model.balanceplatform.PaymentInstrument; import com.adyen.model.balanceplatform.PaymentInstrumentInfo; import com.adyen.model.balanceplatform.PaymentInstrumentRevealInfo; @@ -70,6 +71,39 @@ public PaymentInstrument getPaymentInstrument(String id, RequestOptions requestO return PaymentInstrument.fromJson(jsonResult); } + /** + * List network tokens + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @return {@link ListNetworkTokensResponse } + * @throws ApiException if fails to make API call + */ + public ListNetworkTokensResponse listNetworkTokens(String id) throws ApiException, IOException { + return listNetworkTokens(id, null); + } + + /** + * List network tokens + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListNetworkTokensResponse } + * @throws ApiException if fails to make API call + */ + public ListNetworkTokensResponse listNetworkTokens(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 + "/paymentInstruments/{id}/networkTokens", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return ListNetworkTokensResponse.fromJson(jsonResult); + } + /** * Get the PAN of a payment instrument * diff --git a/src/test/java/com/adyen/BalancePlatformTest.java b/src/test/java/com/adyen/BalancePlatformTest.java index 4773389c6..85f4df4d3 100644 --- a/src/test/java/com/adyen/BalancePlatformTest.java +++ b/src/test/java/com/adyen/BalancePlatformTest.java @@ -79,7 +79,7 @@ public void AccountHoldersRetrieveTest() throws Exception { public void AccountHoldersUpdateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/AccountHolder.json"); AccountHoldersApi service = new AccountHoldersApi(client); - AccountHolder request = AccountHolder.fromJson("{\n" + + AccountHolderUpdateRequest request = AccountHolderUpdateRequest.fromJson("{\n" + " \"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\n" + " \"contactDetails\": {\n" + " \"address\": {\n" + @@ -210,28 +210,8 @@ public void sweepScheduleTest() throws Exception { " }\n" + "}"); - assertThat(request.getSchedule().getActualInstance(), instanceOf(SweepSchedule.class)); - assertEquals(SweepSchedule.TypeEnum.BALANCE, request.getSchedule().getSweepSchedule().getType()); - } - - @Test - public void sweepScheduleUnknownFieldTest() { - JsonMappingException err = assertThrows(JsonMappingException.class, () -> { - SweepConfigurationV2.fromJson("{\n" + - " \"counterparty\": {\n" + - " \"merchantAccount\": \"YOUR_MERCHANT_ACCOUNT\"\n" + - " },\n" + - " \"currency\": \"EUR\",\n" + - " \"id\": \"SWPC4227C224555B5FTD2NT2JV4WN5\",\n" + - " \"schedule\": {\n" + - " \"type\": \"balance\",\n" + - " \"troubleMaker\": \"I'm not part of the specs yet, and that's not cool bro\"\n" + - " }\n" + - "}"); - }); - String msg = err.getMessage(); - - assertTrue(msg.contains("0 classes match result, expected 1")); + assertThat(request.getSchedule(), instanceOf(SweepSchedule.class)); + assertEquals(SweepSchedule.TypeEnum.BALANCE, request.getSchedule().getType()); } @Test @@ -249,19 +229,19 @@ public void cronSweepScheduleTest() throws Exception { " }\n" + "}"); - assertThat(request.getSchedule().getActualInstance(), instanceOf(CronSweepSchedule.class)); - assertEquals(CronSweepSchedule.TypeEnum.CRON, request.getSchedule().getCronSweepSchedule().getType()); - assertEquals("*/5 * * * *", request.getSchedule().getCronSweepSchedule().getCronExpression()); + assertThat(request.getSchedule(), instanceOf(SweepSchedule.class)); + assertEquals(SweepSchedule.TypeEnum.CRON, request.getSchedule().getType()); + assertEquals("*/5 * * * *", request.getSchedule().getCronExpression()); } @Test public void cronSweepScheduleToJsonTest() throws JsonProcessingException { SweepConfigurationV2 request = new SweepConfigurationV2(); request.setType(SweepConfigurationV2.TypeEnum.PULL); - CronSweepSchedule cron = new CronSweepSchedule(); - cron.setType(CronSweepSchedule.TypeEnum.CRON); + SweepSchedule cron = new SweepSchedule(); + cron.setType(SweepSchedule.TypeEnum.CRON); cron.setCronExpression("6 6 6"); - request.setSchedule(new SweepConfigurationV2Schedule(cron)); + request.setSchedule(cron); // request to json String json = request.toJson(); @@ -275,7 +255,7 @@ public void sweepScheduleToJsonTest() throws JsonProcessingException { request.setType(SweepConfigurationV2.TypeEnum.PUSH); SweepSchedule schedule = new SweepSchedule(); schedule.setType(SweepSchedule.TypeEnum.DAILY); - request.setSchedule(new SweepConfigurationV2Schedule(schedule)); + request.setSchedule(schedule); // request to json String json = request.toJson(); @@ -303,7 +283,7 @@ public void BalanceAccountsRetrieveSweepTest() throws Exception { public void BalanceAccountsUpdateSweepTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/SweepConfigurationV2.json"); BalanceAccountsApi service = new BalanceAccountsApi(client); - SweepConfigurationV2 request = SweepConfigurationV2.fromJson("{\n" + + UpdateSweepConfigurationV2 request = UpdateSweepConfigurationV2.fromJson("{\n" + " \"counterparty\": {\n" + " \"merchantAccount\": \"YOUR_MERCHANT_ACCOUNT\"\n" + " },\n" + From 643b2918876ed0d87cd535c6c6cf583947279cbb Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Tue, 8 Aug 2023 15:12:57 +0000 Subject: [PATCH 4/6] Release automation moved to Node --- .github/scripts/helper.js | 19 --------- .github/workflows/gh-release.yml | 37 ++++------------- .github/workflows/release.yml | 69 +++++++------------------------- Makefile | 10 ++++- 4 files changed, 31 insertions(+), 104 deletions(-) delete mode 100644 .github/scripts/helper.js diff --git a/.github/scripts/helper.js b/.github/scripts/helper.js deleted file mode 100644 index 039b30a8e..000000000 --- a/.github/scripts/helper.js +++ /dev/null @@ -1,19 +0,0 @@ -exports.pomJavaVersion = () => { - const fs = require('fs'); - const re = /(\d{1,2}.\d.\d)<\/version>\n.*Adyen Java API Library<\/name>/; - data = fs.readFileSync("pom.xml", 'utf-8'); - version = data.match(re)[1]; - return version; -} - -// Update version in pom.xml and settings -exports.updateJavaVersion = async (version) => { - const fs = require('fs'); - data = fs.readFileSync('src/main/java/com/adyen/Client.java', 'utf-8'); - newVersion = data.replace(/(LIB_VERSION = )"(\d{1,2}\.\d\.\d)"/, "$1" + '"' + version +'"'); - fs.writeFileSync('src/main/java/com/adyen/Client.java', newVersion, 'utf-8'); - - data = fs.readFileSync('pom.xml', 'utf-8'); - newVersion = data.replace(/()(\d{1,2}.\d.\d)(<\/version>\n.*Adyen Java API Library<\/name>)/, "$1" + version + "$3"); - fs.writeFileSync('pom.xml', newVersion, 'utf-8'); -} \ No newline at end of file diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml index 57636c3fe..a0a86c62f 100644 --- a/.github/workflows/gh-release.yml +++ b/.github/workflows/gh-release.yml @@ -1,37 +1,16 @@ name: Github Release on: - workflow_dispatch: - push: - branches: - - main + workflow_dispatch: + push: + branches: + - main jobs: gh_release: permissions: contents: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - - name: Grab version - uses: actions/github-script@v6 - id: release - with: - script: | - const helper = require('./.github/scripts/helper.js') - core.setOutput('version', helper.pomJavaVersion()) - - name: Create new release - env: - GH_TOKEN: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - run: | - gh release create v${{steps.release.outputs.version}} \ - --title 'Adyen Java API Library v${{steps.release.outputs.version}}' \ - --generate-notes --target main - - name: Update develop branch - run: | - git checkout develop - git merge main - git push origin develop + uses: Adyen/adyen-node-api-library/.github/workflows/lib-gh-release.yml@develop + with: + project-name: Java + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 725552944..b437f0925 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,64 +1,23 @@ name: Release request on: - workflow_dispatch: - push: - branches: - - develop + workflow_dispatch: + inputs: + prerelease: + required: false + type: boolean + default: false + description: "This release will be labeled as non-production ready" + push: + branches: + - develop jobs: release: permissions: contents: write pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: main - - name: Reset promotion branch - run: | - git fetch origin develop:develop - git reset --hard develop - - name: Get the release script - run: | - wget https://raw.githubusercontent.com/Adyen/adyen-node-api-library/develop/.github/scripts/release.js -P ./.github/scripts - - name: Prepare release request - uses: actions/github-script@v6 - id: release - with: - script: | - const helper = require('./.github/scripts/helper.js') - const release = require('./.github/scripts/release.js') - const options = { github, context, core, getCurrentVersion: helper.pomJavaVersion }; - await release.bump(options); - - name: Bump version - uses: actions/github-script@v6 - with: - script: | - const helper = require('./.github/scripts/helper.js') - await helper.updateJavaVersion("${{steps.release.outputs.nextVersion}}"); - - name: Delete the release script - run: | - rm -f ./.github/scripts/release.js - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 - with: - token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} - author: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} - branch: automation/release - title: Release v${{steps.release.outputs.nextVersion}} - body: | - Merged pull requests to be released: - ${{steps.release.outputs.changelog}} - commit-message: "chore(release): bump to ${{steps.release.outputs.nextVersion}}" - delete-branch: true - - name: Enable Pull Request Automerge - if: steps.cpr.outputs.pull-request-operation == 'created' - uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0 - with: - token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: merge + uses: Adyen/adyen-node-api-library/.github/workflows/lib-release.yml@develop + with: + prerelease: ${{ inputs.prerelease || false }} + secrets: inherit diff --git a/Makefile b/Makefile index 4bdfbc071..f2aba6e0b 100644 --- a/Makefile +++ b/Makefile @@ -145,5 +145,13 @@ clean: git checkout $(models) git clean -f -d $(models) +## Releases -.PHONY: templates models $(services) +version: + perl -lne 'print "currentVersion=$$1" if /version>(.+?)<\/version/' < pom.xml | head -1 >> "$$GITHUB_OUTPUT" + +version_files:=pom.xml src/main/java/com/adyen/Client.java README.md +bump: + perl -i -pe 's/$$ENV{"CURRENT_VERSION"}/$$ENV{"NEXT_VERSION"}/' $(version_files) + +.PHONY: templates models $(services) version bump From 02f90ec08970652529dba67317ae7e548473c2a6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 10:11:46 +0200 Subject: [PATCH 5/6] chore(deps): update dependency com.squareup.okio:okio to v3.5.0 (#1100) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d7097a03a..420bef328 100644 --- a/pom.xml +++ b/pom.xml @@ -248,7 +248,7 @@ com.squareup.okio okio - 3.4.0 + 3.5.0 test From 0b1315567a9872c872934a739f13624e972d4b9b Mon Sep 17 00:00:00 2001 From: Adyen Automation Date: Wed, 9 Aug 2023 08:27:41 +0000 Subject: [PATCH 6/6] chore(release): bump to 21.1.0 --- README.md | 2 +- pom.xml | 2 +- src/main/java/com/adyen/Client.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0a4346d08..d0d9d0c3d 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ You can use Maven and add this dependency to your project's POM: com.adyen adyen-java-api-library - 21.0.0 + 21.1.0 ``` diff --git a/pom.xml b/pom.xml index 420bef328..4c47133de 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.adyen adyen-java-api-library jar - 21.0.0 + 21.1.0 Adyen Java API Library Adyen API Client Library for Java https://github.com/adyen/adyen-java-api-library diff --git a/src/main/java/com/adyen/Client.java b/src/main/java/com/adyen/Client.java index 4c5dc0af4..f04407abc 100644 --- a/src/main/java/com/adyen/Client.java +++ b/src/main/java/com/adyen/Client.java @@ -32,7 +32,7 @@ public class Client { private Config config; public static final String ENDPOINT_CERT_LIVE = "https://palcert-live.adyen.com"; public static final String LIB_NAME = "adyen-java-api-library"; - public static final String LIB_VERSION = "21.0.0"; + public static final String LIB_VERSION = "21.1.0"; public static final String CHECKOUT_ENDPOINT_CERT_LIVE = "https://checkoutcert-live-%s.adyen.com/checkout"; public static final String TERMINAL_API_ENDPOINT_TEST = "https://terminal-api-test.adyen.com"; public static final String TERMINAL_API_ENDPOINT_LIVE = "https://terminal-api-live.adyen.com";