From e7705fb3ad5352836adf2efe73b8e27c5508290d Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Thu, 23 Jul 2026 13:25:41 +0000 Subject: [PATCH] [balanceplatform] Automated update from Adyen/adyen-openapi@06d0315 --- sdk-generation-log/balanceplatform.json | 6 +- .../model/balanceplatform/AmountDTO.java | 234 ++++++++ .../balanceplatform/CreateRecurringTopUp.java | 516 +++++++++++++++++ .../balanceplatform/PatchableAmountDTO.java | 238 ++++++++ .../PatchableCreateRecurringTopUp.java | 473 +++++++++++++++ .../balanceplatform/PatchableSchedule.java | 175 ++++++ .../balanceplatform/PatchableTopUpAmount.java | 226 ++++++++ .../balanceplatform/PatchableTrigger.java | 225 ++++++++ .../model/balanceplatform/RecurringTopUp.java | 546 ++++++++++++++++++ .../RecurringTopUpsResult.java | 236 ++++++++ .../adyen/model/balanceplatform/Schedule.java | 175 ++++++ .../model/balanceplatform/ScheduleType.java | 60 ++ .../model/balanceplatform/TopUpAmount.java | 222 +++++++ .../balanceplatform/TopUpCounterparty.java | 190 ++++++ .../balanceplatform/TransactionRule.java | 96 ++- .../balanceplatform/TransactionRuleInfo.java | 96 ++- .../adyen/model/balanceplatform/Trigger.java | 222 +++++++ .../balanceplatform/RecurringTopUpsApi.java | 267 +++++++++ .../ScaDeviceManagementApi.java | 32 + 19 files changed, 4218 insertions(+), 17 deletions(-) create mode 100644 src/main/java/com/adyen/model/balanceplatform/AmountDTO.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/CreateRecurringTopUp.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PatchableAmountDTO.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PatchableCreateRecurringTopUp.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PatchableSchedule.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PatchableTopUpAmount.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PatchableTrigger.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/RecurringTopUp.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/RecurringTopUpsResult.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/Schedule.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/ScheduleType.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/TopUpAmount.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/TopUpCounterparty.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/Trigger.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/RecurringTopUpsApi.java diff --git a/sdk-generation-log/balanceplatform.json b/sdk-generation-log/balanceplatform.json index 83afac892..36b48d751 100644 --- a/sdk-generation-log/balanceplatform.json +++ b/sdk-generation-log/balanceplatform.json @@ -1,8 +1,8 @@ { "service": "balanceplatform", "project": "java", - "generatedAt": "2026-07-21T12:28:58Z", - "openapiCommitSha": "c2ff0637d25d1c34aa1b19113e1b4e5eaa289960", + "generatedAt": "2026-07-23T13:25:41Z", + "openapiCommitSha": "06d031500a5565d326553c6b0d14c3c79d13a1eb", "automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397", - "libraryCommitSha": "5ff17f11a78b035f0dd862e1157bec9e026adcf1" + "libraryCommitSha": "7f01d8c3c98591abf7cf85a4db7b7ff76aa7e66b" } diff --git a/src/main/java/com/adyen/model/balanceplatform/AmountDTO.java b/src/main/java/com/adyen/model/balanceplatform/AmountDTO.java new file mode 100644 index 000000000..93115bf47 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/AmountDTO.java @@ -0,0 +1,234 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** AmountDTO */ +@JsonPropertyOrder({AmountDTO.JSON_PROPERTY_CURRENCY, AmountDTO.JSON_PROPERTY_VALUE}) +public class AmountDTO { + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AmountDTO() {} + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * @return the current {@code AmountDTO} instance, allowing for method chaining + */ + public AmountDTO currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + * + * @param value The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + * @return the current {@code AmountDTO} instance, allowing for method chaining + */ + public AmountDTO value(Long value) { + this.value = value; + isSetValue = true; // mark as set + return this; + } + + /** + * The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return value The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + /** + * The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + * + * @param value The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Long value) { + this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountDTO includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this AmountDTO object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AmountDTO amountDTO = (AmountDTO) o; + return Objects.equals(this.currency, amountDTO.currency) + && Objects.equals(this.isSetCurrency, amountDTO.isSetCurrency) + && Objects.equals(this.value, amountDTO.value) + && Objects.equals(this.isSetValue, amountDTO.isSetValue); + } + + @Override + public int hashCode() { + return Objects.hash(currency, isSetCurrency, value, isSetValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AmountDTO {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of AmountDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of AmountDTO + * @throws JsonProcessingException if the JSON string is invalid with respect to AmountDTO + */ + public static AmountDTO fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AmountDTO.class); + } + + /** + * Convert an instance of AmountDTO 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/CreateRecurringTopUp.java b/src/main/java/com/adyen/model/balanceplatform/CreateRecurringTopUp.java new file mode 100644 index 000000000..4bc4d677c --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/CreateRecurringTopUp.java @@ -0,0 +1,516 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** CreateRecurringTopUp */ +@JsonPropertyOrder({ + CreateRecurringTopUp.JSON_PROPERTY_COUNTERPARTY, + CreateRecurringTopUp.JSON_PROPERTY_DESCRIPTION, + CreateRecurringTopUp.JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, + CreateRecurringTopUp.JSON_PROPERTY_STATUS, + CreateRecurringTopUp.JSON_PROPERTY_TOP_UP_AMOUNT, + CreateRecurringTopUp.JSON_PROPERTY_TRIGGER +}) +public class CreateRecurringTopUp { + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; + private TopUpCounterparty counterparty; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; + private String referenceForBeneficiary; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + */ + public enum StatusEnum { + ACTIVE(String.valueOf("active")), + + INACTIVE(String.valueOf("inactive")); + + private static final Logger LOG = Logger.getLogger(StatusEnum.class.getName()); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "StatusEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(StatusEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + public static final String JSON_PROPERTY_TOP_UP_AMOUNT = "topUpAmount"; + private TopUpAmount topUpAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTopUpAmount = false; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private Trigger trigger; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrigger = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CreateRecurringTopUp() {} + + /** + * counterparty + * + * @param counterparty + * @return the current {@code CreateRecurringTopUp} instance, allowing for method chaining + */ + public CreateRecurringTopUp counterparty(TopUpCounterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + return this; + } + + /** + * Get counterparty + * + * @return counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TopUpCounterparty getCounterparty() { + return counterparty; + } + + /** + * counterparty + * + * @param counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCounterparty(TopUpCounterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + } + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @param description Your description for the recurring top-up. Maximum length is 140 characters. + * If you set a longer description, it will be cut off at 140 characters. + * @return the current {@code CreateRecurringTopUp} instance, allowing for method chaining + */ + public CreateRecurringTopUp description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @return description Your description for the recurring top-up. Maximum length is 140 + * characters. If you set a longer description, it will be cut off at 140 characters. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @param description Your description for the recurring top-up. Maximum length is 140 characters. + * If you set a longer description, it will be cut off at 140 characters. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + * @return the current {@code CreateRecurringTopUp} instance, allowing for method chaining + */ + public CreateRecurringTopUp referenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + return this; + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReferenceForBeneficiary() { + return referenceForBeneficiary; + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReferenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @param status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + * @return the current {@code CreateRecurringTopUp} instance, allowing for method chaining + */ + public CreateRecurringTopUp status(StatusEnum status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @return status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @param status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * topUpAmount + * + * @param topUpAmount + * @return the current {@code CreateRecurringTopUp} instance, allowing for method chaining + */ + public CreateRecurringTopUp topUpAmount(TopUpAmount topUpAmount) { + this.topUpAmount = topUpAmount; + isSetTopUpAmount = true; // mark as set + return this; + } + + /** + * Get topUpAmount + * + * @return topUpAmount + */ + @JsonProperty(JSON_PROPERTY_TOP_UP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TopUpAmount getTopUpAmount() { + return topUpAmount; + } + + /** + * topUpAmount + * + * @param topUpAmount + */ + @JsonProperty(JSON_PROPERTY_TOP_UP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTopUpAmount(TopUpAmount topUpAmount) { + this.topUpAmount = topUpAmount; + isSetTopUpAmount = true; // mark as set + } + + /** + * trigger + * + * @param trigger + * @return the current {@code CreateRecurringTopUp} instance, allowing for method chaining + */ + public CreateRecurringTopUp trigger(Trigger trigger) { + this.trigger = trigger; + isSetTrigger = true; // mark as set + return this; + } + + /** + * Get trigger + * + * @return trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Trigger getTrigger() { + return trigger; + } + + /** + * trigger + * + * @param trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrigger(Trigger trigger) { + this.trigger = trigger; + isSetTrigger = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateRecurringTopUp includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CreateRecurringTopUp object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateRecurringTopUp createRecurringTopUp = (CreateRecurringTopUp) o; + return Objects.equals(this.counterparty, createRecurringTopUp.counterparty) + && Objects.equals(this.isSetCounterparty, createRecurringTopUp.isSetCounterparty) + && Objects.equals(this.description, createRecurringTopUp.description) + && Objects.equals(this.isSetDescription, createRecurringTopUp.isSetDescription) + && Objects.equals( + this.referenceForBeneficiary, createRecurringTopUp.referenceForBeneficiary) + && Objects.equals( + this.isSetReferenceForBeneficiary, createRecurringTopUp.isSetReferenceForBeneficiary) + && Objects.equals(this.status, createRecurringTopUp.status) + && Objects.equals(this.isSetStatus, createRecurringTopUp.isSetStatus) + && Objects.equals(this.topUpAmount, createRecurringTopUp.topUpAmount) + && Objects.equals(this.isSetTopUpAmount, createRecurringTopUp.isSetTopUpAmount) + && Objects.equals(this.trigger, createRecurringTopUp.trigger) + && Objects.equals(this.isSetTrigger, createRecurringTopUp.isSetTrigger); + } + + @Override + public int hashCode() { + return Objects.hash( + counterparty, + isSetCounterparty, + description, + isSetDescription, + referenceForBeneficiary, + isSetReferenceForBeneficiary, + status, + isSetStatus, + topUpAmount, + isSetTopUpAmount, + trigger, + isSetTrigger); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateRecurringTopUp {\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" referenceForBeneficiary: ") + .append(toIndentedString(referenceForBeneficiary)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" topUpAmount: ").append(toIndentedString(topUpAmount)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTopUpAmount) { + addIfNull(nulls, JSON_PROPERTY_TOP_UP_AMOUNT, this.topUpAmount); + } + if (isSetTrigger) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER, this.trigger); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CreateRecurringTopUp given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateRecurringTopUp + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CreateRecurringTopUp + */ + public static CreateRecurringTopUp fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CreateRecurringTopUp.class); + } + + /** + * Convert an instance of CreateRecurringTopUp 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/PatchableAmountDTO.java b/src/main/java/com/adyen/model/balanceplatform/PatchableAmountDTO.java new file mode 100644 index 000000000..fcdf3ff83 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PatchableAmountDTO.java @@ -0,0 +1,238 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PatchableAmountDTO */ +@JsonPropertyOrder({ + PatchableAmountDTO.JSON_PROPERTY_CURRENCY, + PatchableAmountDTO.JSON_PROPERTY_VALUE +}) +public class PatchableAmountDTO { + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PatchableAmountDTO() {} + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * @return the current {@code PatchableAmountDTO} instance, allowing for method chaining + */ + public PatchableAmountDTO currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + * + * @param value The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + * @return the current {@code PatchableAmountDTO} instance, allowing for method chaining + */ + public PatchableAmountDTO value(Long value) { + this.value = value; + isSetValue = true; // mark as set + return this; + } + + /** + * The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return value The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + /** + * The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + * + * @param value The amount of the transaction, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Long value) { + this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PatchableAmountDTO includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PatchableAmountDTO object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchableAmountDTO patchableAmountDTO = (PatchableAmountDTO) o; + return Objects.equals(this.currency, patchableAmountDTO.currency) + && Objects.equals(this.isSetCurrency, patchableAmountDTO.isSetCurrency) + && Objects.equals(this.value, patchableAmountDTO.value) + && Objects.equals(this.isSetValue, patchableAmountDTO.isSetValue); + } + + @Override + public int hashCode() { + return Objects.hash(currency, isSetCurrency, value, isSetValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchableAmountDTO {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PatchableAmountDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchableAmountDTO + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PatchableAmountDTO + */ + public static PatchableAmountDTO fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PatchableAmountDTO.class); + } + + /** + * Convert an instance of PatchableAmountDTO 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/PatchableCreateRecurringTopUp.java b/src/main/java/com/adyen/model/balanceplatform/PatchableCreateRecurringTopUp.java new file mode 100644 index 000000000..92d066dd3 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PatchableCreateRecurringTopUp.java @@ -0,0 +1,473 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** PatchableCreateRecurringTopUp */ +@JsonPropertyOrder({ + PatchableCreateRecurringTopUp.JSON_PROPERTY_DESCRIPTION, + PatchableCreateRecurringTopUp.JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, + PatchableCreateRecurringTopUp.JSON_PROPERTY_STATUS, + PatchableCreateRecurringTopUp.JSON_PROPERTY_TOP_UP_AMOUNT, + PatchableCreateRecurringTopUp.JSON_PROPERTY_TRIGGER +}) +public class PatchableCreateRecurringTopUp { + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; + private Object referenceForBeneficiary; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + */ + public enum StatusEnum { + ACTIVE(String.valueOf("active")), + + INACTIVE(String.valueOf("inactive")); + + private static final Logger LOG = Logger.getLogger(StatusEnum.class.getName()); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "StatusEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(StatusEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + public static final String JSON_PROPERTY_TOP_UP_AMOUNT = "topUpAmount"; + private PatchableTopUpAmount topUpAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTopUpAmount = false; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private PatchableTrigger trigger; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrigger = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PatchableCreateRecurringTopUp() {} + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @param description Your description for the recurring top-up. Maximum length is 140 characters. + * If you set a longer description, it will be cut off at 140 characters. + * @return the current {@code PatchableCreateRecurringTopUp} instance, allowing for method + * chaining + */ + public PatchableCreateRecurringTopUp description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @return description Your description for the recurring top-up. Maximum length is 140 + * characters. If you set a longer description, it will be cut off at 140 characters. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @param description Your description for the recurring top-up. Maximum length is 140 characters. + * If you set a longer description, it will be cut off at 140 characters. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + * @return the current {@code PatchableCreateRecurringTopUp} instance, allowing for method + * chaining + */ + public PatchableCreateRecurringTopUp referenceForBeneficiary(Object referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + return this; + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getReferenceForBeneficiary() { + return referenceForBeneficiary; + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReferenceForBeneficiary(Object referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @param status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + * @return the current {@code PatchableCreateRecurringTopUp} instance, allowing for method + * chaining + */ + public PatchableCreateRecurringTopUp status(StatusEnum status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @return status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @param status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * topUpAmount + * + * @param topUpAmount + * @return the current {@code PatchableCreateRecurringTopUp} instance, allowing for method + * chaining + */ + public PatchableCreateRecurringTopUp topUpAmount(PatchableTopUpAmount topUpAmount) { + this.topUpAmount = topUpAmount; + isSetTopUpAmount = true; // mark as set + return this; + } + + /** + * Get topUpAmount + * + * @return topUpAmount + */ + @JsonProperty(JSON_PROPERTY_TOP_UP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchableTopUpAmount getTopUpAmount() { + return topUpAmount; + } + + /** + * topUpAmount + * + * @param topUpAmount + */ + @JsonProperty(JSON_PROPERTY_TOP_UP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTopUpAmount(PatchableTopUpAmount topUpAmount) { + this.topUpAmount = topUpAmount; + isSetTopUpAmount = true; // mark as set + } + + /** + * trigger + * + * @param trigger + * @return the current {@code PatchableCreateRecurringTopUp} instance, allowing for method + * chaining + */ + public PatchableCreateRecurringTopUp trigger(PatchableTrigger trigger) { + this.trigger = trigger; + isSetTrigger = true; // mark as set + return this; + } + + /** + * Get trigger + * + * @return trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchableTrigger getTrigger() { + return trigger; + } + + /** + * trigger + * + * @param trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrigger(PatchableTrigger trigger) { + this.trigger = trigger; + isSetTrigger = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PatchableCreateRecurringTopUp includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PatchableCreateRecurringTopUp object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchableCreateRecurringTopUp patchableCreateRecurringTopUp = (PatchableCreateRecurringTopUp) o; + return Objects.equals(this.description, patchableCreateRecurringTopUp.description) + && Objects.equals(this.isSetDescription, patchableCreateRecurringTopUp.isSetDescription) + && Objects.equals( + this.referenceForBeneficiary, patchableCreateRecurringTopUp.referenceForBeneficiary) + && Objects.equals( + this.isSetReferenceForBeneficiary, + patchableCreateRecurringTopUp.isSetReferenceForBeneficiary) + && Objects.equals(this.status, patchableCreateRecurringTopUp.status) + && Objects.equals(this.isSetStatus, patchableCreateRecurringTopUp.isSetStatus) + && Objects.equals(this.topUpAmount, patchableCreateRecurringTopUp.topUpAmount) + && Objects.equals(this.isSetTopUpAmount, patchableCreateRecurringTopUp.isSetTopUpAmount) + && Objects.equals(this.trigger, patchableCreateRecurringTopUp.trigger) + && Objects.equals(this.isSetTrigger, patchableCreateRecurringTopUp.isSetTrigger); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + isSetDescription, + referenceForBeneficiary, + isSetReferenceForBeneficiary, + status, + isSetStatus, + topUpAmount, + isSetTopUpAmount, + trigger, + isSetTrigger); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchableCreateRecurringTopUp {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" referenceForBeneficiary: ") + .append(toIndentedString(referenceForBeneficiary)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" topUpAmount: ").append(toIndentedString(topUpAmount)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTopUpAmount) { + addIfNull(nulls, JSON_PROPERTY_TOP_UP_AMOUNT, this.topUpAmount); + } + if (isSetTrigger) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER, this.trigger); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PatchableCreateRecurringTopUp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchableCreateRecurringTopUp + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PatchableCreateRecurringTopUp + */ + public static PatchableCreateRecurringTopUp fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PatchableCreateRecurringTopUp.class); + } + + /** + * Convert an instance of PatchableCreateRecurringTopUp 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/PatchableSchedule.java b/src/main/java/com/adyen/model/balanceplatform/PatchableSchedule.java new file mode 100644 index 000000000..6029757a8 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PatchableSchedule.java @@ -0,0 +1,175 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PatchableSchedule */ +@JsonPropertyOrder({PatchableSchedule.JSON_PROPERTY_TYPE}) +public class PatchableSchedule { + public static final String JSON_PROPERTY_TYPE = "type"; + private ScheduleType type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PatchableSchedule() {} + + /** + * type + * + * @param type + * @return the current {@code PatchableSchedule} instance, allowing for method chaining + */ + public PatchableSchedule type(ScheduleType type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Get type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ScheduleType getType() { + return type; + } + + /** + * type + * + * @param type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(ScheduleType type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PatchableSchedule includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PatchableSchedule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchableSchedule patchableSchedule = (PatchableSchedule) o; + return Objects.equals(this.type, patchableSchedule.type) + && Objects.equals(this.isSetType, patchableSchedule.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash(type, isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchableSchedule {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PatchableSchedule given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchableSchedule + * @throws JsonProcessingException if the JSON string is invalid with respect to PatchableSchedule + */ + public static PatchableSchedule fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PatchableSchedule.class); + } + + /** + * Convert an instance of PatchableSchedule 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/PatchableTopUpAmount.java b/src/main/java/com/adyen/model/balanceplatform/PatchableTopUpAmount.java new file mode 100644 index 000000000..84a76d81a --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PatchableTopUpAmount.java @@ -0,0 +1,226 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PatchableTopUpAmount */ +@JsonPropertyOrder({ + PatchableTopUpAmount.JSON_PROPERTY_FIXED, + PatchableTopUpAmount.JSON_PROPERTY_TARGET +}) +public class PatchableTopUpAmount { + public static final String JSON_PROPERTY_FIXED = "fixed"; + private PatchableAmountDTO fixed; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFixed = false; + + public static final String JSON_PROPERTY_TARGET = "target"; + private PatchableAmountDTO target; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTarget = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PatchableTopUpAmount() {} + + /** + * fixed + * + * @param fixed + * @return the current {@code PatchableTopUpAmount} instance, allowing for method chaining + */ + public PatchableTopUpAmount fixed(PatchableAmountDTO fixed) { + this.fixed = fixed; + isSetFixed = true; // mark as set + return this; + } + + /** + * Get fixed + * + * @return fixed + */ + @JsonProperty(JSON_PROPERTY_FIXED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchableAmountDTO getFixed() { + return fixed; + } + + /** + * fixed + * + * @param fixed + */ + @JsonProperty(JSON_PROPERTY_FIXED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFixed(PatchableAmountDTO fixed) { + this.fixed = fixed; + isSetFixed = true; // mark as set + } + + /** + * target + * + * @param target + * @return the current {@code PatchableTopUpAmount} instance, allowing for method chaining + */ + public PatchableTopUpAmount target(PatchableAmountDTO target) { + this.target = target; + isSetTarget = true; // mark as set + return this; + } + + /** + * Get target + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchableAmountDTO getTarget() { + return target; + } + + /** + * target + * + * @param target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTarget(PatchableAmountDTO target) { + this.target = target; + isSetTarget = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PatchableTopUpAmount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PatchableTopUpAmount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchableTopUpAmount patchableTopUpAmount = (PatchableTopUpAmount) o; + return Objects.equals(this.fixed, patchableTopUpAmount.fixed) + && Objects.equals(this.isSetFixed, patchableTopUpAmount.isSetFixed) + && Objects.equals(this.target, patchableTopUpAmount.target) + && Objects.equals(this.isSetTarget, patchableTopUpAmount.isSetTarget); + } + + @Override + public int hashCode() { + return Objects.hash(fixed, isSetFixed, target, isSetTarget); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchableTopUpAmount {\n"); + sb.append(" fixed: ").append(toIndentedString(fixed)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFixed) { + addIfNull(nulls, JSON_PROPERTY_FIXED, this.fixed); + } + if (isSetTarget) { + addIfNull(nulls, JSON_PROPERTY_TARGET, this.target); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PatchableTopUpAmount given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchableTopUpAmount + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PatchableTopUpAmount + */ + public static PatchableTopUpAmount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PatchableTopUpAmount.class); + } + + /** + * Convert an instance of PatchableTopUpAmount 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/PatchableTrigger.java b/src/main/java/com/adyen/model/balanceplatform/PatchableTrigger.java new file mode 100644 index 000000000..f4b610c90 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PatchableTrigger.java @@ -0,0 +1,225 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PatchableTrigger */ +@JsonPropertyOrder({ + PatchableTrigger.JSON_PROPERTY_SCHEDULE, + PatchableTrigger.JSON_PROPERTY_THRESHOLD +}) +public class PatchableTrigger { + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; + private PatchableSchedule schedule; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; + private PatchableAmountDTO threshold; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreshold = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PatchableTrigger() {} + + /** + * schedule + * + * @param schedule + * @return the current {@code PatchableTrigger} instance, allowing for method chaining + */ + public PatchableTrigger schedule(PatchableSchedule schedule) { + this.schedule = schedule; + isSetSchedule = true; // mark as set + return this; + } + + /** + * Get schedule + * + * @return schedule + */ + @JsonProperty(JSON_PROPERTY_SCHEDULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchableSchedule getSchedule() { + return schedule; + } + + /** + * schedule + * + * @param schedule + */ + @JsonProperty(JSON_PROPERTY_SCHEDULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchedule(PatchableSchedule schedule) { + this.schedule = schedule; + isSetSchedule = true; // mark as set + } + + /** + * threshold + * + * @param threshold + * @return the current {@code PatchableTrigger} instance, allowing for method chaining + */ + public PatchableTrigger threshold(PatchableAmountDTO threshold) { + this.threshold = threshold; + isSetThreshold = true; // mark as set + return this; + } + + /** + * Get threshold + * + * @return threshold + */ + @JsonProperty(JSON_PROPERTY_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchableAmountDTO getThreshold() { + return threshold; + } + + /** + * threshold + * + * @param threshold + */ + @JsonProperty(JSON_PROPERTY_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreshold(PatchableAmountDTO threshold) { + this.threshold = threshold; + isSetThreshold = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PatchableTrigger includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PatchableTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchableTrigger patchableTrigger = (PatchableTrigger) o; + return Objects.equals(this.schedule, patchableTrigger.schedule) + && Objects.equals(this.isSetSchedule, patchableTrigger.isSetSchedule) + && Objects.equals(this.threshold, patchableTrigger.threshold) + && Objects.equals(this.isSetThreshold, patchableTrigger.isSetThreshold); + } + + @Override + public int hashCode() { + return Objects.hash(schedule, isSetSchedule, threshold, isSetThreshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchableTrigger {\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetThreshold) { + addIfNull(nulls, JSON_PROPERTY_THRESHOLD, this.threshold); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PatchableTrigger given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchableTrigger + * @throws JsonProcessingException if the JSON string is invalid with respect to PatchableTrigger + */ + public static PatchableTrigger fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PatchableTrigger.class); + } + + /** + * Convert an instance of PatchableTrigger 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/RecurringTopUp.java b/src/main/java/com/adyen/model/balanceplatform/RecurringTopUp.java new file mode 100644 index 000000000..3aa73a156 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/RecurringTopUp.java @@ -0,0 +1,546 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** RecurringTopUp */ +@JsonPropertyOrder({ + RecurringTopUp.JSON_PROPERTY_COUNTERPARTY, + RecurringTopUp.JSON_PROPERTY_DESCRIPTION, + RecurringTopUp.JSON_PROPERTY_ID, + RecurringTopUp.JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, + RecurringTopUp.JSON_PROPERTY_STATUS, + RecurringTopUp.JSON_PROPERTY_TOP_UP_AMOUNT, + RecurringTopUp.JSON_PROPERTY_TRIGGER +}) +public class RecurringTopUp { + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; + private TopUpCounterparty counterparty; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; + private String referenceForBeneficiary; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + */ + public enum StatusEnum { + ACTIVE(String.valueOf("active")), + + INACTIVE(String.valueOf("inactive")); + + private static final Logger LOG = Logger.getLogger(StatusEnum.class.getName()); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "StatusEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(StatusEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + public static final String JSON_PROPERTY_TOP_UP_AMOUNT = "topUpAmount"; + private TopUpAmount topUpAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTopUpAmount = false; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private Trigger trigger; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrigger = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public RecurringTopUp() {} + + @JsonCreator + public RecurringTopUp(@JsonProperty(JSON_PROPERTY_ID) String id) { + this(); + this.id = id; + } + + /** + * counterparty + * + * @param counterparty + * @return the current {@code RecurringTopUp} instance, allowing for method chaining + */ + public RecurringTopUp counterparty(TopUpCounterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + return this; + } + + /** + * Get counterparty + * + * @return counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TopUpCounterparty getCounterparty() { + return counterparty; + } + + /** + * counterparty + * + * @param counterparty + */ + @JsonProperty(JSON_PROPERTY_COUNTERPARTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCounterparty(TopUpCounterparty counterparty) { + this.counterparty = counterparty; + isSetCounterparty = true; // mark as set + } + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @param description Your description for the recurring top-up. Maximum length is 140 characters. + * If you set a longer description, it will be cut off at 140 characters. + * @return the current {@code RecurringTopUp} instance, allowing for method chaining + */ + public RecurringTopUp description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @return description Your description for the recurring top-up. Maximum length is 140 + * characters. If you set a longer description, it will be cut off at 140 characters. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * Your description for the recurring top-up. Maximum length is 140 characters. If you set a + * longer description, it will be cut off at 140 characters. + * + * @param description Your description for the recurring top-up. Maximum length is 140 characters. + * If you set a longer description, it will be cut off at 140 characters. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * The unique identifier of the top up. + * + * @return id The unique identifier of the top up. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + * @return the current {@code RecurringTopUp} instance, allowing for method chaining + */ + public RecurringTopUp referenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + return this; + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReferenceForBeneficiary() { + return referenceForBeneficiary; + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related + * to the transfer, so you can use it to track statuses for both parties involved in the funds + * movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @param referenceForBeneficiary A reference that is sent to the recipient. This reference is + * also sent in all webhooks related to the transfer, so you can use it to track statuses for + * both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, + * **0-9**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReferenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @param status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + * @return the current {@code RecurringTopUp} instance, allowing for method chaining + */ + public RecurringTopUp status(StatusEnum status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @return status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + /** + * The status of the recurring top-up. If not provided, by default, this is set to **active**. + * Possible values: * **active**: the top up is enabled and funds will be pulled in. * + * **inactive**: the top up is disabled and cannot be triggered. + * + * @param status The status of the recurring top-up. If not provided, by default, this is set to + * **active**. Possible values: * **active**: the top up is enabled and funds will be pulled + * in. * **inactive**: the top up is disabled and cannot be triggered. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * topUpAmount + * + * @param topUpAmount + * @return the current {@code RecurringTopUp} instance, allowing for method chaining + */ + public RecurringTopUp topUpAmount(TopUpAmount topUpAmount) { + this.topUpAmount = topUpAmount; + isSetTopUpAmount = true; // mark as set + return this; + } + + /** + * Get topUpAmount + * + * @return topUpAmount + */ + @JsonProperty(JSON_PROPERTY_TOP_UP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TopUpAmount getTopUpAmount() { + return topUpAmount; + } + + /** + * topUpAmount + * + * @param topUpAmount + */ + @JsonProperty(JSON_PROPERTY_TOP_UP_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTopUpAmount(TopUpAmount topUpAmount) { + this.topUpAmount = topUpAmount; + isSetTopUpAmount = true; // mark as set + } + + /** + * trigger + * + * @param trigger + * @return the current {@code RecurringTopUp} instance, allowing for method chaining + */ + public RecurringTopUp trigger(Trigger trigger) { + this.trigger = trigger; + isSetTrigger = true; // mark as set + return this; + } + + /** + * Get trigger + * + * @return trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Trigger getTrigger() { + return trigger; + } + + /** + * trigger + * + * @param trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrigger(Trigger trigger) { + this.trigger = trigger; + isSetTrigger = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RecurringTopUp includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this RecurringTopUp object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecurringTopUp recurringTopUp = (RecurringTopUp) o; + return Objects.equals(this.counterparty, recurringTopUp.counterparty) + && Objects.equals(this.isSetCounterparty, recurringTopUp.isSetCounterparty) + && Objects.equals(this.description, recurringTopUp.description) + && Objects.equals(this.isSetDescription, recurringTopUp.isSetDescription) + && Objects.equals(this.id, recurringTopUp.id) + && Objects.equals(this.isSetId, recurringTopUp.isSetId) + && Objects.equals(this.referenceForBeneficiary, recurringTopUp.referenceForBeneficiary) + && Objects.equals( + this.isSetReferenceForBeneficiary, recurringTopUp.isSetReferenceForBeneficiary) + && Objects.equals(this.status, recurringTopUp.status) + && Objects.equals(this.isSetStatus, recurringTopUp.isSetStatus) + && Objects.equals(this.topUpAmount, recurringTopUp.topUpAmount) + && Objects.equals(this.isSetTopUpAmount, recurringTopUp.isSetTopUpAmount) + && Objects.equals(this.trigger, recurringTopUp.trigger) + && Objects.equals(this.isSetTrigger, recurringTopUp.isSetTrigger); + } + + @Override + public int hashCode() { + return Objects.hash( + counterparty, + isSetCounterparty, + description, + isSetDescription, + id, + isSetId, + referenceForBeneficiary, + isSetReferenceForBeneficiary, + status, + isSetStatus, + topUpAmount, + isSetTopUpAmount, + trigger, + isSetTrigger); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecurringTopUp {\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" referenceForBeneficiary: ") + .append(toIndentedString(referenceForBeneficiary)) + .append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" topUpAmount: ").append(toIndentedString(topUpAmount)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTopUpAmount) { + addIfNull(nulls, JSON_PROPERTY_TOP_UP_AMOUNT, this.topUpAmount); + } + if (isSetTrigger) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER, this.trigger); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of RecurringTopUp given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecurringTopUp + * @throws JsonProcessingException if the JSON string is invalid with respect to RecurringTopUp + */ + public static RecurringTopUp fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, RecurringTopUp.class); + } + + /** + * Convert an instance of RecurringTopUp 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/RecurringTopUpsResult.java b/src/main/java/com/adyen/model/balanceplatform/RecurringTopUpsResult.java new file mode 100644 index 000000000..a3a95940a --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/RecurringTopUpsResult.java @@ -0,0 +1,236 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** RecurringTopUpsResult */ +@JsonPropertyOrder({ + RecurringTopUpsResult.JSON_PROPERTY_LINK, + RecurringTopUpsResult.JSON_PROPERTY_RECURRING_TOP_UPS +}) +public class RecurringTopUpsResult { + public static final String JSON_PROPERTY_LINK = "link"; + private Link link; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLink = false; + + public static final String JSON_PROPERTY_RECURRING_TOP_UPS = "recurringTopUps"; + private List recurringTopUps; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringTopUps = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public RecurringTopUpsResult() {} + + /** + * link + * + * @param link + * @return the current {@code RecurringTopUpsResult} instance, allowing for method chaining + */ + public RecurringTopUpsResult link(Link link) { + this.link = link; + isSetLink = true; // mark as set + return this; + } + + /** + * Get link + * + * @return link + */ + @JsonProperty(JSON_PROPERTY_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Link getLink() { + return link; + } + + /** + * link + * + * @param link + */ + @JsonProperty(JSON_PROPERTY_LINK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLink(Link link) { + this.link = link; + isSetLink = true; // mark as set + } + + /** + * recurringTopUps + * + * @param recurringTopUps + * @return the current {@code RecurringTopUpsResult} instance, allowing for method chaining + */ + public RecurringTopUpsResult recurringTopUps(List recurringTopUps) { + this.recurringTopUps = recurringTopUps; + isSetRecurringTopUps = true; // mark as set + return this; + } + + public RecurringTopUpsResult addRecurringTopUpsItem(RecurringTopUp recurringTopUpsItem) { + if (this.recurringTopUps == null) { + this.recurringTopUps = new ArrayList<>(); + } + this.recurringTopUps.add(recurringTopUpsItem); + return this; + } + + /** + * Get recurringTopUps + * + * @return recurringTopUps + */ + @JsonProperty(JSON_PROPERTY_RECURRING_TOP_UPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRecurringTopUps() { + return recurringTopUps; + } + + /** + * recurringTopUps + * + * @param recurringTopUps + */ + @JsonProperty(JSON_PROPERTY_RECURRING_TOP_UPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecurringTopUps(List recurringTopUps) { + this.recurringTopUps = recurringTopUps; + isSetRecurringTopUps = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RecurringTopUpsResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this RecurringTopUpsResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecurringTopUpsResult recurringTopUpsResult = (RecurringTopUpsResult) o; + return Objects.equals(this.link, recurringTopUpsResult.link) + && Objects.equals(this.isSetLink, recurringTopUpsResult.isSetLink) + && Objects.equals(this.recurringTopUps, recurringTopUpsResult.recurringTopUps) + && Objects.equals(this.isSetRecurringTopUps, recurringTopUpsResult.isSetRecurringTopUps); + } + + @Override + public int hashCode() { + return Objects.hash(link, isSetLink, recurringTopUps, isSetRecurringTopUps); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecurringTopUpsResult {\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" recurringTopUps: ").append(toIndentedString(recurringTopUps)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLink) { + addIfNull(nulls, JSON_PROPERTY_LINK, this.link); + } + if (isSetRecurringTopUps) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_TOP_UPS, this.recurringTopUps); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of RecurringTopUpsResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecurringTopUpsResult + * @throws JsonProcessingException if the JSON string is invalid with respect to + * RecurringTopUpsResult + */ + public static RecurringTopUpsResult fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, RecurringTopUpsResult.class); + } + + /** + * Convert an instance of RecurringTopUpsResult 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/Schedule.java b/src/main/java/com/adyen/model/balanceplatform/Schedule.java new file mode 100644 index 000000000..da9530274 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/Schedule.java @@ -0,0 +1,175 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Schedule */ +@JsonPropertyOrder({Schedule.JSON_PROPERTY_TYPE}) +public class Schedule { + public static final String JSON_PROPERTY_TYPE = "type"; + private ScheduleType type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Schedule() {} + + /** + * type + * + * @param type + * @return the current {@code Schedule} instance, allowing for method chaining + */ + public Schedule type(ScheduleType type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Get type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ScheduleType getType() { + return type; + } + + /** + * type + * + * @param type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(ScheduleType type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Schedule includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Schedule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Schedule schedule = (Schedule) o; + return Objects.equals(this.type, schedule.type) + && Objects.equals(this.isSetType, schedule.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash(type, isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Schedule {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Schedule given an JSON string + * + * @param jsonString JSON string + * @return An instance of Schedule + * @throws JsonProcessingException if the JSON string is invalid with respect to Schedule + */ + public static Schedule fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Schedule.class); + } + + /** + * Convert an instance of Schedule 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/ScheduleType.java b/src/main/java/com/adyen/model/balanceplatform/ScheduleType.java new file mode 100644 index 000000000..b5f76bbec --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/ScheduleType.java @@ -0,0 +1,60 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; +import java.util.logging.Logger; + +/** Gets or Sets ScheduleType */ +public enum ScheduleType { + WEEKDAYS("weekdays"), + + WEEKLY("weekly"), + + MONTHLY("monthly"); + + private static final Logger LOG = Logger.getLogger(ScheduleType.class.getName()); + + private String value; + + ScheduleType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ScheduleType fromValue(String value) { + for (ScheduleType b : ScheduleType.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "ScheduleType: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ScheduleType.values())); + return null; + } +} diff --git a/src/main/java/com/adyen/model/balanceplatform/TopUpAmount.java b/src/main/java/com/adyen/model/balanceplatform/TopUpAmount.java new file mode 100644 index 000000000..4cd931084 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/TopUpAmount.java @@ -0,0 +1,222 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** TopUpAmount */ +@JsonPropertyOrder({TopUpAmount.JSON_PROPERTY_FIXED, TopUpAmount.JSON_PROPERTY_TARGET}) +public class TopUpAmount { + public static final String JSON_PROPERTY_FIXED = "fixed"; + private AmountDTO fixed; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFixed = false; + + public static final String JSON_PROPERTY_TARGET = "target"; + private AmountDTO target; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTarget = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TopUpAmount() {} + + /** + * fixed + * + * @param fixed + * @return the current {@code TopUpAmount} instance, allowing for method chaining + */ + public TopUpAmount fixed(AmountDTO fixed) { + this.fixed = fixed; + isSetFixed = true; // mark as set + return this; + } + + /** + * Get fixed + * + * @return fixed + */ + @JsonProperty(JSON_PROPERTY_FIXED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AmountDTO getFixed() { + return fixed; + } + + /** + * fixed + * + * @param fixed + */ + @JsonProperty(JSON_PROPERTY_FIXED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFixed(AmountDTO fixed) { + this.fixed = fixed; + isSetFixed = true; // mark as set + } + + /** + * target + * + * @param target + * @return the current {@code TopUpAmount} instance, allowing for method chaining + */ + public TopUpAmount target(AmountDTO target) { + this.target = target; + isSetTarget = true; // mark as set + return this; + } + + /** + * Get target + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AmountDTO getTarget() { + return target; + } + + /** + * target + * + * @param target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTarget(AmountDTO target) { + this.target = target; + isSetTarget = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TopUpAmount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TopUpAmount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TopUpAmount topUpAmount = (TopUpAmount) o; + return Objects.equals(this.fixed, topUpAmount.fixed) + && Objects.equals(this.isSetFixed, topUpAmount.isSetFixed) + && Objects.equals(this.target, topUpAmount.target) + && Objects.equals(this.isSetTarget, topUpAmount.isSetTarget); + } + + @Override + public int hashCode() { + return Objects.hash(fixed, isSetFixed, target, isSetTarget); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TopUpAmount {\n"); + sb.append(" fixed: ").append(toIndentedString(fixed)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFixed) { + addIfNull(nulls, JSON_PROPERTY_FIXED, this.fixed); + } + if (isSetTarget) { + addIfNull(nulls, JSON_PROPERTY_TARGET, this.target); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TopUpAmount given an JSON string + * + * @param jsonString JSON string + * @return An instance of TopUpAmount + * @throws JsonProcessingException if the JSON string is invalid with respect to TopUpAmount + */ + public static TopUpAmount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TopUpAmount.class); + } + + /** + * Convert an instance of TopUpAmount 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/TopUpCounterparty.java b/src/main/java/com/adyen/model/balanceplatform/TopUpCounterparty.java new file mode 100644 index 000000000..48bde45ba --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/TopUpCounterparty.java @@ -0,0 +1,190 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** TopUpCounterparty */ +@JsonPropertyOrder({TopUpCounterparty.JSON_PROPERTY_TRANSFER_INSTRUMENT_ID}) +public class TopUpCounterparty { + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + private String transferInstrumentId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public TopUpCounterparty() {} + + /** + * The unique identifier of the [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * that is funding the top-up. + * + * @param transferInstrumentId The unique identifier of the [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * that is funding the top-up. + * @return the current {@code TopUpCounterparty} instance, allowing for method chaining + */ + public TopUpCounterparty transferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + return this; + } + + /** + * The unique identifier of the [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * that is funding the top-up. + * + * @return transferInstrumentId The unique identifier of the [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * that is funding the top-up. + */ + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransferInstrumentId() { + return transferInstrumentId; + } + + /** + * The unique identifier of the [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * that is funding the top-up. + * + * @param transferInstrumentId The unique identifier of the [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * that is funding the top-up. + */ + @JsonProperty(JSON_PROPERTY_TRANSFER_INSTRUMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TopUpCounterparty includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this TopUpCounterparty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TopUpCounterparty topUpCounterparty = (TopUpCounterparty) o; + return Objects.equals(this.transferInstrumentId, topUpCounterparty.transferInstrumentId) + && Objects.equals( + this.isSetTransferInstrumentId, topUpCounterparty.isSetTransferInstrumentId); + } + + @Override + public int hashCode() { + return Objects.hash(transferInstrumentId, isSetTransferInstrumentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TopUpCounterparty {\n"); + sb.append(" transferInstrumentId: ") + .append(toIndentedString(transferInstrumentId)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of TopUpCounterparty given an JSON string + * + * @param jsonString JSON string + * @return An instance of TopUpCounterparty + * @throws JsonProcessingException if the JSON string is invalid with respect to TopUpCounterparty + */ + public static TopUpCounterparty fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, TopUpCounterparty.class); + } + + /** + * Convert an instance of TopUpCounterparty 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/TransactionRule.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java index ab585e6ed..ec963746f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java @@ -32,6 +32,7 @@ TransactionRule.JSON_PROPERTY_ID, TransactionRule.JSON_PROPERTY_INTERVAL, TransactionRule.JSON_PROPERTY_OUTCOME_TYPE, + TransactionRule.JSON_PROPERTY_OVERRIDES_RULE, TransactionRule.JSON_PROPERTY_PURPOSE, TransactionRule.JSON_PROPERTY_REFERENCE, TransactionRule.JSON_PROPERTY_REQUEST_TYPE, @@ -139,6 +140,12 @@ public static OutcomeTypeEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_OVERRIDES_RULE = "overridesRule"; + private String overridesRule; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOverridesRule = false; + /** * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the @@ -335,13 +342,18 @@ public static StatusEnum fromValue(String value) { * the amount or number of transactions for the lifetime of a payment instrument, and then decline * a transaction when the specified limits are met. * **velocity**: add the amount or number of * transactions based on a specified time interval, and then decline a transaction when the - * specified limits are met. + * specified limits are met. * **bypass**: bypass or skip a rule for the specified + * `entityKey`. Transactions processed to that entity are no longer evaluated by the + * bypassed rule. You must provide the `id` of the rule to bypass in + * `overridesRule` and leave the `ruleRestrictions` object empty. */ public enum TypeEnum { ALLOWLIST(String.valueOf("allowList")), BLOCKLIST(String.valueOf("blockList")), + BYPASS(String.valueOf("bypass")), + MAXUSAGE(String.valueOf("maxUsage")), VELOCITY(String.valueOf("velocity")); @@ -733,6 +745,47 @@ public void setOutcomeType(OutcomeTypeEnum outcomeType) { isSetOutcomeType = true; // mark as set } + /** + * The `id` of the transaction rule you want to override or skip for the specified + * `entityKey`. + * + * @param overridesRule The `id` of the transaction rule you want to override or skip + * for the specified `entityKey`. + * @return the current {@code TransactionRule} instance, allowing for method chaining + */ + public TransactionRule overridesRule(String overridesRule) { + this.overridesRule = overridesRule; + isSetOverridesRule = true; // mark as set + return this; + } + + /** + * The `id` of the transaction rule you want to override or skip for the specified + * `entityKey`. + * + * @return overridesRule The `id` of the transaction rule you want to override or skip + * for the specified `entityKey`. + */ + @JsonProperty(JSON_PROPERTY_OVERRIDES_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverridesRule() { + return overridesRule; + } + + /** + * The `id` of the transaction rule you want to override or skip for the specified + * `entityKey`. + * + * @param overridesRule The `id` of the transaction rule you want to override or skip + * for the specified `entityKey`. + */ + @JsonProperty(JSON_PROPERTY_OVERRIDES_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverridesRule(String overridesRule) { + this.overridesRule = overridesRule; + isSetOverridesRule = true; // mark as set + } + /** * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the @@ -1060,7 +1113,10 @@ public void setStatus(StatusEnum status) { * the amount or number of transactions for the lifetime of a payment instrument, and then decline * a transaction when the specified limits are met. * **velocity**: add the amount or number of * transactions based on a specified time interval, and then decline a transaction when the - * specified limits are met. + * specified limits are met. * **bypass**: bypass or skip a rule for the specified + * `entityKey`. Transactions processed to that entity are no longer evaluated by the + * bypassed rule. You must provide the `id` of the rule to bypass in + * `overridesRule` and leave the `ruleRestrictions` object empty. * * @param type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), * which defines if a rule blocks transactions based on individual characteristics or @@ -1068,7 +1124,11 @@ public void setStatus(StatusEnum status) { * conditions are met. * **maxUsage**: add the amount or number of transactions for the * lifetime of a payment instrument, and then decline a transaction when the specified limits * are met. * **velocity**: add the amount or number of transactions based on a specified time - * interval, and then decline a transaction when the specified limits are met. + * interval, and then decline a transaction when the specified limits are met. * **bypass**: + * bypass or skip a rule for the specified `entityKey`. Transactions processed to + * that entity are no longer evaluated by the bypassed rule. You must provide the + * `id` of the rule to bypass in `overridesRule` and leave the + * `ruleRestrictions` object empty. * @return the current {@code TransactionRule} instance, allowing for method chaining */ public TransactionRule type(TypeEnum type) { @@ -1084,7 +1144,10 @@ public TransactionRule type(TypeEnum type) { * the amount or number of transactions for the lifetime of a payment instrument, and then decline * a transaction when the specified limits are met. * **velocity**: add the amount or number of * transactions based on a specified time interval, and then decline a transaction when the - * specified limits are met. + * specified limits are met. * **bypass**: bypass or skip a rule for the specified + * `entityKey`. Transactions processed to that entity are no longer evaluated by the + * bypassed rule. You must provide the `id` of the rule to bypass in + * `overridesRule` and leave the `ruleRestrictions` object empty. * * @return type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), * which defines if a rule blocks transactions based on individual characteristics or @@ -1092,7 +1155,11 @@ public TransactionRule type(TypeEnum type) { * conditions are met. * **maxUsage**: add the amount or number of transactions for the * lifetime of a payment instrument, and then decline a transaction when the specified limits * are met. * **velocity**: add the amount or number of transactions based on a specified time - * interval, and then decline a transaction when the specified limits are met. + * interval, and then decline a transaction when the specified limits are met. * **bypass**: + * bypass or skip a rule for the specified `entityKey`. Transactions processed to + * that entity are no longer evaluated by the bypassed rule. You must provide the + * `id` of the rule to bypass in `overridesRule` and leave the + * `ruleRestrictions` object empty. */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1107,7 +1174,10 @@ public TypeEnum getType() { * the amount or number of transactions for the lifetime of a payment instrument, and then decline * a transaction when the specified limits are met. * **velocity**: add the amount or number of * transactions based on a specified time interval, and then decline a transaction when the - * specified limits are met. + * specified limits are met. * **bypass**: bypass or skip a rule for the specified + * `entityKey`. Transactions processed to that entity are no longer evaluated by the + * bypassed rule. You must provide the `id` of the rule to bypass in + * `overridesRule` and leave the `ruleRestrictions` object empty. * * @param type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), * which defines if a rule blocks transactions based on individual characteristics or @@ -1115,7 +1185,11 @@ public TypeEnum getType() { * conditions are met. * **maxUsage**: add the amount or number of transactions for the * lifetime of a payment instrument, and then decline a transaction when the specified limits * are met. * **velocity**: add the amount or number of transactions based on a specified time - * interval, and then decline a transaction when the specified limits are met. + * interval, and then decline a transaction when the specified limits are met. * **bypass**: + * bypass or skip a rule for the specified `entityKey`. Transactions processed to + * that entity are no longer evaluated by the bypassed rule. You must provide the + * `id` of the rule to bypass in `overridesRule` and leave the + * `ruleRestrictions` object empty. */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1168,6 +1242,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetInterval, transactionRule.isSetInterval) && Objects.equals(this.outcomeType, transactionRule.outcomeType) && Objects.equals(this.isSetOutcomeType, transactionRule.isSetOutcomeType) + && Objects.equals(this.overridesRule, transactionRule.overridesRule) + && Objects.equals(this.isSetOverridesRule, transactionRule.isSetOverridesRule) && Objects.equals(this.purpose, transactionRule.purpose) && Objects.equals(this.isSetPurpose, transactionRule.isSetPurpose) && Objects.equals(this.reference, transactionRule.reference) @@ -1203,6 +1279,8 @@ public int hashCode() { isSetInterval, outcomeType, isSetOutcomeType, + overridesRule, + isSetOverridesRule, purpose, isSetPurpose, reference, @@ -1232,6 +1310,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); sb.append(" outcomeType: ").append(toIndentedString(outcomeType)).append("\n"); + sb.append(" overridesRule: ").append(toIndentedString(overridesRule)).append("\n"); sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); @@ -1285,6 +1364,9 @@ public Map getExplicitNulls() { if (isSetOutcomeType) { addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); } + if (isSetOverridesRule) { + addIfNull(nulls, JSON_PROPERTY_OVERRIDES_RULE, this.overridesRule); + } if (isSetPurpose) { addIfNull(nulls, JSON_PROPERTY_PURPOSE, this.purpose); } diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java index bc9931eb2..955947aec 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java @@ -31,6 +31,7 @@ TransactionRuleInfo.JSON_PROPERTY_ENTITY_KEY, TransactionRuleInfo.JSON_PROPERTY_INTERVAL, TransactionRuleInfo.JSON_PROPERTY_OUTCOME_TYPE, + TransactionRuleInfo.JSON_PROPERTY_OVERRIDES_RULE, TransactionRuleInfo.JSON_PROPERTY_PURPOSE, TransactionRuleInfo.JSON_PROPERTY_REFERENCE, TransactionRuleInfo.JSON_PROPERTY_REQUEST_TYPE, @@ -132,6 +133,12 @@ public static OutcomeTypeEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_OVERRIDES_RULE = "overridesRule"; + private String overridesRule; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOverridesRule = false; + /** * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the @@ -328,13 +335,18 @@ public static StatusEnum fromValue(String value) { * the amount or number of transactions for the lifetime of a payment instrument, and then decline * a transaction when the specified limits are met. * **velocity**: add the amount or number of * transactions based on a specified time interval, and then decline a transaction when the - * specified limits are met. + * specified limits are met. * **bypass**: bypass or skip a rule for the specified + * `entityKey`. Transactions processed to that entity are no longer evaluated by the + * bypassed rule. You must provide the `id` of the rule to bypass in + * `overridesRule` and leave the `ruleRestrictions` object empty. */ public enum TypeEnum { ALLOWLIST(String.valueOf("allowList")), BLOCKLIST(String.valueOf("blockList")), + BYPASS(String.valueOf("bypass")), + MAXUSAGE(String.valueOf("maxUsage")), VELOCITY(String.valueOf("velocity")); @@ -691,6 +703,47 @@ public void setOutcomeType(OutcomeTypeEnum outcomeType) { isSetOutcomeType = true; // mark as set } + /** + * The `id` of the transaction rule you want to override or skip for the specified + * `entityKey`. + * + * @param overridesRule The `id` of the transaction rule you want to override or skip + * for the specified `entityKey`. + * @return the current {@code TransactionRuleInfo} instance, allowing for method chaining + */ + public TransactionRuleInfo overridesRule(String overridesRule) { + this.overridesRule = overridesRule; + isSetOverridesRule = true; // mark as set + return this; + } + + /** + * The `id` of the transaction rule you want to override or skip for the specified + * `entityKey`. + * + * @return overridesRule The `id` of the transaction rule you want to override or skip + * for the specified `entityKey`. + */ + @JsonProperty(JSON_PROPERTY_OVERRIDES_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverridesRule() { + return overridesRule; + } + + /** + * The `id` of the transaction rule you want to override or skip for the specified + * `entityKey`. + * + * @param overridesRule The `id` of the transaction rule you want to override or skip + * for the specified `entityKey`. + */ + @JsonProperty(JSON_PROPERTY_OVERRIDES_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOverridesRule(String overridesRule) { + this.overridesRule = overridesRule; + isSetOverridesRule = true; // mark as set + } + /** * Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created * to regulate fraudulent activity. * **policy**: the rule is created to ensure that the @@ -1018,7 +1071,10 @@ public void setStatus(StatusEnum status) { * the amount or number of transactions for the lifetime of a payment instrument, and then decline * a transaction when the specified limits are met. * **velocity**: add the amount or number of * transactions based on a specified time interval, and then decline a transaction when the - * specified limits are met. + * specified limits are met. * **bypass**: bypass or skip a rule for the specified + * `entityKey`. Transactions processed to that entity are no longer evaluated by the + * bypassed rule. You must provide the `id` of the rule to bypass in + * `overridesRule` and leave the `ruleRestrictions` object empty. * * @param type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), * which defines if a rule blocks transactions based on individual characteristics or @@ -1026,7 +1082,11 @@ public void setStatus(StatusEnum status) { * conditions are met. * **maxUsage**: add the amount or number of transactions for the * lifetime of a payment instrument, and then decline a transaction when the specified limits * are met. * **velocity**: add the amount or number of transactions based on a specified time - * interval, and then decline a transaction when the specified limits are met. + * interval, and then decline a transaction when the specified limits are met. * **bypass**: + * bypass or skip a rule for the specified `entityKey`. Transactions processed to + * that entity are no longer evaluated by the bypassed rule. You must provide the + * `id` of the rule to bypass in `overridesRule` and leave the + * `ruleRestrictions` object empty. * @return the current {@code TransactionRuleInfo} instance, allowing for method chaining */ public TransactionRuleInfo type(TypeEnum type) { @@ -1042,7 +1102,10 @@ public TransactionRuleInfo type(TypeEnum type) { * the amount or number of transactions for the lifetime of a payment instrument, and then decline * a transaction when the specified limits are met. * **velocity**: add the amount or number of * transactions based on a specified time interval, and then decline a transaction when the - * specified limits are met. + * specified limits are met. * **bypass**: bypass or skip a rule for the specified + * `entityKey`. Transactions processed to that entity are no longer evaluated by the + * bypassed rule. You must provide the `id` of the rule to bypass in + * `overridesRule` and leave the `ruleRestrictions` object empty. * * @return type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), * which defines if a rule blocks transactions based on individual characteristics or @@ -1050,7 +1113,11 @@ public TransactionRuleInfo type(TypeEnum type) { * conditions are met. * **maxUsage**: add the amount or number of transactions for the * lifetime of a payment instrument, and then decline a transaction when the specified limits * are met. * **velocity**: add the amount or number of transactions based on a specified time - * interval, and then decline a transaction when the specified limits are met. + * interval, and then decline a transaction when the specified limits are met. * **bypass**: + * bypass or skip a rule for the specified `entityKey`. Transactions processed to + * that entity are no longer evaluated by the bypassed rule. You must provide the + * `id` of the rule to bypass in `overridesRule` and leave the + * `ruleRestrictions` object empty. */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1065,7 +1132,10 @@ public TypeEnum getType() { * the amount or number of transactions for the lifetime of a payment instrument, and then decline * a transaction when the specified limits are met. * **velocity**: add the amount or number of * transactions based on a specified time interval, and then decline a transaction when the - * specified limits are met. + * specified limits are met. * **bypass**: bypass or skip a rule for the specified + * `entityKey`. Transactions processed to that entity are no longer evaluated by the + * bypassed rule. You must provide the `id` of the rule to bypass in + * `overridesRule` and leave the `ruleRestrictions` object empty. * * @param type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), * which defines if a rule blocks transactions based on individual characteristics or @@ -1073,7 +1143,11 @@ public TypeEnum getType() { * conditions are met. * **maxUsage**: add the amount or number of transactions for the * lifetime of a payment instrument, and then decline a transaction when the specified limits * are met. * **velocity**: add the amount or number of transactions based on a specified time - * interval, and then decline a transaction when the specified limits are met. + * interval, and then decline a transaction when the specified limits are met. * **bypass**: + * bypass or skip a rule for the specified `entityKey`. Transactions processed to + * that entity are no longer evaluated by the bypassed rule. You must provide the + * `id` of the rule to bypass in `overridesRule` and leave the + * `ruleRestrictions` object empty. */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1124,6 +1198,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetInterval, transactionRuleInfo.isSetInterval) && Objects.equals(this.outcomeType, transactionRuleInfo.outcomeType) && Objects.equals(this.isSetOutcomeType, transactionRuleInfo.isSetOutcomeType) + && Objects.equals(this.overridesRule, transactionRuleInfo.overridesRule) + && Objects.equals(this.isSetOverridesRule, transactionRuleInfo.isSetOverridesRule) && Objects.equals(this.purpose, transactionRuleInfo.purpose) && Objects.equals(this.isSetPurpose, transactionRuleInfo.isSetPurpose) && Objects.equals(this.reference, transactionRuleInfo.reference) @@ -1157,6 +1233,8 @@ public int hashCode() { isSetInterval, outcomeType, isSetOutcomeType, + overridesRule, + isSetOverridesRule, purpose, isSetPurpose, reference, @@ -1185,6 +1263,7 @@ public String toString() { sb.append(" entityKey: ").append(toIndentedString(entityKey)).append("\n"); sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); sb.append(" outcomeType: ").append(toIndentedString(outcomeType)).append("\n"); + sb.append(" overridesRule: ").append(toIndentedString(overridesRule)).append("\n"); sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); @@ -1235,6 +1314,9 @@ public Map getExplicitNulls() { if (isSetOutcomeType) { addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); } + if (isSetOverridesRule) { + addIfNull(nulls, JSON_PROPERTY_OVERRIDES_RULE, this.overridesRule); + } if (isSetPurpose) { addIfNull(nulls, JSON_PROPERTY_PURPOSE, this.purpose); } diff --git a/src/main/java/com/adyen/model/balanceplatform/Trigger.java b/src/main/java/com/adyen/model/balanceplatform/Trigger.java new file mode 100644 index 000000000..51c6ff596 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/Trigger.java @@ -0,0 +1,222 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balanceplatform; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Trigger */ +@JsonPropertyOrder({Trigger.JSON_PROPERTY_SCHEDULE, Trigger.JSON_PROPERTY_THRESHOLD}) +public class Trigger { + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; + private Schedule schedule; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; + private AmountDTO threshold; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreshold = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Trigger() {} + + /** + * schedule + * + * @param schedule + * @return the current {@code Trigger} instance, allowing for method chaining + */ + public Trigger schedule(Schedule schedule) { + this.schedule = schedule; + isSetSchedule = true; // mark as set + return this; + } + + /** + * Get schedule + * + * @return schedule + */ + @JsonProperty(JSON_PROPERTY_SCHEDULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Schedule getSchedule() { + return schedule; + } + + /** + * schedule + * + * @param schedule + */ + @JsonProperty(JSON_PROPERTY_SCHEDULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchedule(Schedule schedule) { + this.schedule = schedule; + isSetSchedule = true; // mark as set + } + + /** + * threshold + * + * @param threshold + * @return the current {@code Trigger} instance, allowing for method chaining + */ + public Trigger threshold(AmountDTO threshold) { + this.threshold = threshold; + isSetThreshold = true; // mark as set + return this; + } + + /** + * Get threshold + * + * @return threshold + */ + @JsonProperty(JSON_PROPERTY_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AmountDTO getThreshold() { + return threshold; + } + + /** + * threshold + * + * @param threshold + */ + @JsonProperty(JSON_PROPERTY_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreshold(AmountDTO threshold) { + this.threshold = threshold; + isSetThreshold = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Trigger includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Trigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Trigger trigger = (Trigger) o; + return Objects.equals(this.schedule, trigger.schedule) + && Objects.equals(this.isSetSchedule, trigger.isSetSchedule) + && Objects.equals(this.threshold, trigger.threshold) + && Objects.equals(this.isSetThreshold, trigger.isSetThreshold); + } + + @Override + public int hashCode() { + return Objects.hash(schedule, isSetSchedule, threshold, isSetThreshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Trigger {\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetThreshold) { + addIfNull(nulls, JSON_PROPERTY_THRESHOLD, this.threshold); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Trigger given an JSON string + * + * @param jsonString JSON string + * @return An instance of Trigger + * @throws JsonProcessingException if the JSON string is invalid with respect to Trigger + */ + public static Trigger fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Trigger.class); + } + + /** + * Convert an instance of Trigger 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/RecurringTopUpsApi.java b/src/main/java/com/adyen/service/balanceplatform/RecurringTopUpsApi.java new file mode 100644 index 000000000..66d2c91a7 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/RecurringTopUpsApi.java @@ -0,0 +1,267 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.RequestOptions; +import com.adyen.model.balanceplatform.CreateRecurringTopUp; +import com.adyen.model.balanceplatform.PatchableCreateRecurringTopUp; +import com.adyen.model.balanceplatform.RecurringTopUp; +import com.adyen.model.balanceplatform.RecurringTopUpsResult; +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 RecurringTopUpsApi extends Service { + + public static final String API_VERSION = "2"; + + protected String baseURL; + + /** + * Recurring top ups constructor in {@link com.adyen.service.balanceplatform package}. + * + * @param client {@link Client } (required) + */ + public RecurringTopUpsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Recurring top ups constructor in {@link com.adyen.service.balanceplatform package}. Please use + * this constructor only if you would like to pass along your own url for routing or testing + * purposes. The latest API version is defined in this class as a constant. + * + * @param client {@link Client } (required) + * @param baseURL {@link String } (required) + */ + public RecurringTopUpsApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Create recurring top up + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. + * (required) + * @param createRecurringTopUp {@link CreateRecurringTopUp } (required) + * @return {@link RecurringTopUp } + * @throws ApiException if fails to make API call + */ + public RecurringTopUp createRecurringTopUp( + String balanceAccountId, CreateRecurringTopUp createRecurringTopUp) + throws ApiException, IOException { + return createRecurringTopUp(balanceAccountId, createRecurringTopUp, null); + } + + /** + * Create recurring top up + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. + * (required) + * @param createRecurringTopUp {@link CreateRecurringTopUp } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link RecurringTopUp } + * @throws ApiException if fails to make API call + */ + public RecurringTopUp createRecurringTopUp( + String balanceAccountId, + CreateRecurringTopUp createRecurringTopUp, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + + String requestBody = createRecurringTopUp.toJson(); + Resource resource = + new Resource( + this, this.baseURL + "/balanceAccounts/{balanceAccountId}/recurringTopUps", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return RecurringTopUp.fromJson(jsonResult); + } + + /** + * Delete a recurring top up + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. + * (required) + * @param topUpId {@link String } The unique identifier of the recurring top-up you want to + * delete. (required) + * @throws ApiException if fails to make API call + */ + public void deleteRecurringTopUp(String balanceAccountId, String topUpId) + throws ApiException, IOException { + deleteRecurringTopUp(balanceAccountId, topUpId, null); + } + + /** + * Delete a recurring top up + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. + * (required) + * @param topUpId {@link String } The unique identifier of the recurring top-up you want to + * delete. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void deleteRecurringTopUp( + String balanceAccountId, String topUpId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + if (topUpId == null) { + throw new IllegalArgumentException("Please provide the topUpId path parameter"); + } + pathParams.put("topUpId", topUpId); + + String requestBody = null; + Resource resource = + new Resource( + this, + this.baseURL + "/balanceAccounts/{balanceAccountId}/recurringTopUps/{topUpId}", + null); + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get recurring top ups for a specific balanceAccountId + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. + * (required) + * @return {@link RecurringTopUpsResult } + * @throws ApiException if fails to make API call + */ + public RecurringTopUpsResult getRecurringTopUps(String balanceAccountId) + throws ApiException, IOException { + return getRecurringTopUps(balanceAccountId, null, null, null); + } + + /** + * Get recurring top ups for a specific balanceAccountId + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. + * (required) + * @param limit {@link Integer } Query: The number of items to return per page. Value must be + * between 1 and 100. (optional, default to 10) + * @param cursor {@link String } Query: The cursor used for pagination. Required if you want to + * see the next or previous page of results. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link RecurringTopUpsResult } + * @throws ApiException if fails to make API call + */ + public RecurringTopUpsResult getRecurringTopUps( + String balanceAccountId, Integer limit, String cursor, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + + // Add query params + Map queryParams = new HashMap<>(); + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + if (cursor != null) { + queryParams.put("cursor", cursor); + } + + String requestBody = null; + Resource resource = + new Resource( + this, this.baseURL + "/balanceAccounts/{balanceAccountId}/recurringTopUps", null); + String jsonResult = + resource.request( + requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return RecurringTopUpsResult.fromJson(jsonResult); + } + + /** + * Update a RecurringTopUp + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. + * (required) + * @param topUpId {@link String } The unique identifier of the recurring top-up you want to + * update. (required) + * @param patchableCreateRecurringTopUp {@link PatchableCreateRecurringTopUp } (required) + * @return {@link RecurringTopUp } + * @throws ApiException if fails to make API call + */ + public RecurringTopUp updateRecurringTopUps( + String balanceAccountId, + String topUpId, + PatchableCreateRecurringTopUp patchableCreateRecurringTopUp) + throws ApiException, IOException { + return updateRecurringTopUps(balanceAccountId, topUpId, patchableCreateRecurringTopUp, null); + } + + /** + * Update a RecurringTopUp + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. + * (required) + * @param topUpId {@link String } The unique identifier of the recurring top-up you want to + * update. (required) + * @param patchableCreateRecurringTopUp {@link PatchableCreateRecurringTopUp } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link RecurringTopUp } + * @throws ApiException if fails to make API call + */ + public RecurringTopUp updateRecurringTopUps( + String balanceAccountId, + String topUpId, + PatchableCreateRecurringTopUp patchableCreateRecurringTopUp, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + if (topUpId == null) { + throw new IllegalArgumentException("Please provide the topUpId path parameter"); + } + pathParams.put("topUpId", topUpId); + + String requestBody = patchableCreateRecurringTopUp.toJson(); + Resource resource = + new Resource( + this, + this.baseURL + "/balanceAccounts/{balanceAccountId}/recurringTopUps/{topUpId}", + null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return RecurringTopUp.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/ScaDeviceManagementApi.java b/src/main/java/com/adyen/service/balanceplatform/ScaDeviceManagementApi.java index fe6d3fb37..c76ba2475 100644 --- a/src/main/java/com/adyen/service/balanceplatform/ScaDeviceManagementApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/ScaDeviceManagementApi.java @@ -89,6 +89,38 @@ public BeginScaDeviceRegistrationResponse beginScaDeviceRegistration( return BeginScaDeviceRegistrationResponse.fromJson(jsonResult); } + /** + * Delete an SCA device + * + * @param deviceId {@link String } The unique identifier of the SCA device to delete. (required) + * @throws ApiException if fails to make API call + */ + public void deleteScaDevice(String deviceId) throws ApiException, IOException { + deleteScaDevice(deviceId, null); + } + + /** + * Delete an SCA device + * + * @param deviceId {@link String } The unique identifier of the SCA device to delete. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void deleteScaDevice(String deviceId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/scaDevices/{deviceId}", null); + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams); + } + /** * Finish registration process for a SCA device *