From d5043f97aa82d9ebcb460a53e349073eb565a033 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Tue, 21 Jul 2026 13:17:05 +0000 Subject: [PATCH 1/2] [management] Automated update from Adyen/adyen-openapi@c2ff063 --- sdk-generation-log/management.json | 8 +- .../management/AssociatedPaymentMethod.java | 283 ++++++++ .../management/CampaignStatusTransition.java | 58 ++ .../adyen/model/management/CarnetInfo.java | 240 +++++++ .../model/management/CashAppUpdateInfo.java | 225 ++++++ .../DefaultErrorResponseEntity.java | 547 ++++++++++++++ .../model/management/DisplayTextField.java | 58 ++ .../model/management/DonationAmount.java | 247 +++++++ .../management/DonationAmountUpdate.java | 248 +++++++ .../model/management/DonationCampaign.java | 541 ++++++++++++++ .../DonationCampaignNonprofitCause.java | 573 +++++++++++++++ .../management/DonationCampaignRequest.java | 396 ++++++++++ .../management/DonationCampaignStatus.java | 60 ++ .../management/DonationCampaignUpdate.java | 343 +++++++++ .../adyen/model/management/DonationFlow.java | 58 ++ .../adyen/model/management/DonationType.java | 60 ++ .../management/InPersonDonationSettings.java | 584 +++++++++++++++ .../InPersonDonationSettingsResponse.java | 667 +++++++++++++++++ .../InPersonDonationSettingsUpdate.java | 597 +++++++++++++++ .../ListDonationCampaignsResponse.java | 345 +++++++++ .../management/ListNonprofitsRequest.java | 189 +++++ .../management/ListNonprofitsResponse.java | 340 +++++++++ .../model/management/MealVoucherFRInfo.java | 12 +- .../com/adyen/model/management/Nonprofit.java | 680 ++++++++++++++++++ .../model/management/NonprofitCause.java | 395 ++++++++++ .../management/OnlineDonationSettings.java | 357 +++++++++ .../OnlineDonationSettingsResponse.java | 445 ++++++++++++ .../OnlineDonationSettingsUpdate.java | 359 +++++++++ .../adyen/model/management/PaymentMethod.java | 66 ++ .../management/PaymentMethodResponse.java | 2 + .../management/PaymentMethodSetupInfo.java | 10 +- ...leTerminalActionsRequestActionDetails.java | 18 + .../management/SplitConfigurationLogic.java | 50 ++ .../com/adyen/model/management/SplitDcc.java | 177 +++++ .../com/adyen/model/management/Surcharge.java | 55 ++ .../adyen/model/management/Unreferenced.java | 33 +- .../management/UpdatePaymentMethodInfo.java | 50 ++ .../UpdateSplitConfigurationLogicRequest.java | 51 ++ .../management/DonationCampaignsApi.java | 415 +++++++++++ 39 files changed, 9822 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/adyen/model/management/AssociatedPaymentMethod.java create mode 100644 src/main/java/com/adyen/model/management/CampaignStatusTransition.java create mode 100644 src/main/java/com/adyen/model/management/CarnetInfo.java create mode 100644 src/main/java/com/adyen/model/management/CashAppUpdateInfo.java create mode 100644 src/main/java/com/adyen/model/management/DefaultErrorResponseEntity.java create mode 100644 src/main/java/com/adyen/model/management/DisplayTextField.java create mode 100644 src/main/java/com/adyen/model/management/DonationAmount.java create mode 100644 src/main/java/com/adyen/model/management/DonationAmountUpdate.java create mode 100644 src/main/java/com/adyen/model/management/DonationCampaign.java create mode 100644 src/main/java/com/adyen/model/management/DonationCampaignNonprofitCause.java create mode 100644 src/main/java/com/adyen/model/management/DonationCampaignRequest.java create mode 100644 src/main/java/com/adyen/model/management/DonationCampaignStatus.java create mode 100644 src/main/java/com/adyen/model/management/DonationCampaignUpdate.java create mode 100644 src/main/java/com/adyen/model/management/DonationFlow.java create mode 100644 src/main/java/com/adyen/model/management/DonationType.java create mode 100644 src/main/java/com/adyen/model/management/InPersonDonationSettings.java create mode 100644 src/main/java/com/adyen/model/management/InPersonDonationSettingsResponse.java create mode 100644 src/main/java/com/adyen/model/management/InPersonDonationSettingsUpdate.java create mode 100644 src/main/java/com/adyen/model/management/ListDonationCampaignsResponse.java create mode 100644 src/main/java/com/adyen/model/management/ListNonprofitsRequest.java create mode 100644 src/main/java/com/adyen/model/management/ListNonprofitsResponse.java create mode 100644 src/main/java/com/adyen/model/management/Nonprofit.java create mode 100644 src/main/java/com/adyen/model/management/NonprofitCause.java create mode 100644 src/main/java/com/adyen/model/management/OnlineDonationSettings.java create mode 100644 src/main/java/com/adyen/model/management/OnlineDonationSettingsResponse.java create mode 100644 src/main/java/com/adyen/model/management/OnlineDonationSettingsUpdate.java create mode 100644 src/main/java/com/adyen/model/management/SplitDcc.java create mode 100644 src/main/java/com/adyen/service/management/DonationCampaignsApi.java diff --git a/sdk-generation-log/management.json b/sdk-generation-log/management.json index df47e3496..27b9ebf7c 100644 --- a/sdk-generation-log/management.json +++ b/sdk-generation-log/management.json @@ -1,8 +1,8 @@ { "service": "management", "project": "java", - "generatedAt": "2026-06-01T09:45:27Z", - "openapiCommitSha": "c0822241f611e20376f72b279f2b3e67dea27a43", - "automationCommitSha": "6f06b47d0661f0891defe6b85461d2c367fbd284", - "libraryCommitSha": "b2ec3b93864e9e4a5548fa7e77fccd50da77ec2f" + "generatedAt": "2026-07-21T13:17:05Z", + "openapiCommitSha": "c2ff0637d25d1c34aa1b19113e1b4e5eaa289960", + "automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397", + "libraryCommitSha": "eebe7978ae86e44506c5a2dc292a119d58212d88" } diff --git a/src/main/java/com/adyen/model/management/AssociatedPaymentMethod.java b/src/main/java/com/adyen/model/management/AssociatedPaymentMethod.java new file mode 100644 index 000000000..85625dc2d --- /dev/null +++ b/src/main/java/com/adyen/model/management/AssociatedPaymentMethod.java @@ -0,0 +1,283 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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.*; + +/** AssociatedPaymentMethod */ +@JsonPropertyOrder({ + AssociatedPaymentMethod.JSON_PROPERTY_ENABLED, + AssociatedPaymentMethod.JSON_PROPERTY_ID, + AssociatedPaymentMethod.JSON_PROPERTY_TYPE +}) +public class AssociatedPaymentMethod { + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = 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_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public AssociatedPaymentMethod() {} + + /** + * Indicates whether the payment method is enabled (**true**) or disabled (**false**). + * + * @param enabled Indicates whether the payment method is enabled (**true**) or disabled + * (**false**). + * @return the current {@code AssociatedPaymentMethod} instance, allowing for method chaining + */ + public AssociatedPaymentMethod enabled(Boolean enabled) { + this.enabled = enabled; + isSetEnabled = true; // mark as set + return this; + } + + /** + * Indicates whether the payment method is enabled (**true**) or disabled (**false**). + * + * @return enabled Indicates whether the payment method is enabled (**true**) or disabled + * (**false**). + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + /** + * Indicates whether the payment method is enabled (**true**) or disabled (**false**). + * + * @param enabled Indicates whether the payment method is enabled (**true**) or disabled + * (**false**). + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + isSetEnabled = true; // mark as set + } + + /** + * The identifier of the payment method. + * + * @param id The identifier of the payment method. + * @return the current {@code AssociatedPaymentMethod} instance, allowing for method chaining + */ + public AssociatedPaymentMethod id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The identifier of the payment method. + * + * @return id The identifier of the payment method. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The identifier of the payment method. + * + * @param id The identifier of the payment method. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * Payment method + * [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + * + * @param type Payment method + * [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + * @return the current {@code AssociatedPaymentMethod} instance, allowing for method chaining + */ + public AssociatedPaymentMethod type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Payment method + * [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + * + * @return type Payment method + * [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * Payment method + * [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + * + * @param type Payment method + * [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociatedPaymentMethod 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 AssociatedPaymentMethod object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssociatedPaymentMethod associatedPaymentMethod = (AssociatedPaymentMethod) o; + return Objects.equals(this.enabled, associatedPaymentMethod.enabled) + && Objects.equals(this.isSetEnabled, associatedPaymentMethod.isSetEnabled) + && Objects.equals(this.id, associatedPaymentMethod.id) + && Objects.equals(this.isSetId, associatedPaymentMethod.isSetId) + && Objects.equals(this.type, associatedPaymentMethod.type) + && Objects.equals(this.isSetType, associatedPaymentMethod.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, isSetEnabled, id, isSetId, type, isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssociatedPaymentMethod {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** 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 (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 AssociatedPaymentMethod given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssociatedPaymentMethod + * @throws JsonProcessingException if the JSON string is invalid with respect to + * AssociatedPaymentMethod + */ + public static AssociatedPaymentMethod fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, AssociatedPaymentMethod.class); + } + + /** + * Convert an instance of AssociatedPaymentMethod 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/management/CampaignStatusTransition.java b/src/main/java/com/adyen/model/management/CampaignStatusTransition.java new file mode 100644 index 000000000..4a75c66f2 --- /dev/null +++ b/src/main/java/com/adyen/model/management/CampaignStatusTransition.java @@ -0,0 +1,58 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; +import java.util.logging.Logger; + +/** Gets or Sets CampaignStatusTransition */ +public enum CampaignStatusTransition { + ACTIVATE("activate"), + + END("end"); + + private static final Logger LOG = Logger.getLogger(CampaignStatusTransition.class.getName()); + + private String value; + + CampaignStatusTransition(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static CampaignStatusTransition fromValue(String value) { + for (CampaignStatusTransition b : CampaignStatusTransition.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "CampaignStatusTransition: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(CampaignStatusTransition.values())); + return null; + } +} diff --git a/src/main/java/com/adyen/model/management/CarnetInfo.java b/src/main/java/com/adyen/model/management/CarnetInfo.java new file mode 100644 index 000000000..a40fe6b7e --- /dev/null +++ b/src/main/java/com/adyen/model/management/CarnetInfo.java @@ -0,0 +1,240 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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.*; + +/** CarnetInfo */ +@JsonPropertyOrder({ + CarnetInfo.JSON_PROPERTY_ADD_MCC_ACRONYM, + CarnetInfo.JSON_PROPERTY_TRANSACTION_DESCRIPTION +}) +public class CarnetInfo { + public static final String JSON_PROPERTY_ADD_MCC_ACRONYM = "addMccAcronym"; + private Boolean addMccAcronym; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddMccAcronym = false; + + public static final String JSON_PROPERTY_TRANSACTION_DESCRIPTION = "transactionDescription"; + private TransactionDescriptionInfo transactionDescription; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionDescription = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CarnetInfo() {} + + /** + * Indicates whether to add the MCC acronym to the merchant name for Prosa acquirer in Mexico. + * When set to **true**, the MCC acronym is automatically appended to the merchant name. Default: + * **false**. + * + * @param addMccAcronym Indicates whether to add the MCC acronym to the merchant name for Prosa + * acquirer in Mexico. When set to **true**, the MCC acronym is automatically appended to the + * merchant name. Default: **false**. + * @return the current {@code CarnetInfo} instance, allowing for method chaining + */ + public CarnetInfo addMccAcronym(Boolean addMccAcronym) { + this.addMccAcronym = addMccAcronym; + isSetAddMccAcronym = true; // mark as set + return this; + } + + /** + * Indicates whether to add the MCC acronym to the merchant name for Prosa acquirer in Mexico. + * When set to **true**, the MCC acronym is automatically appended to the merchant name. Default: + * **false**. + * + * @return addMccAcronym Indicates whether to add the MCC acronym to the merchant name for Prosa + * acquirer in Mexico. When set to **true**, the MCC acronym is automatically appended to the + * merchant name. Default: **false**. + */ + @JsonProperty(JSON_PROPERTY_ADD_MCC_ACRONYM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAddMccAcronym() { + return addMccAcronym; + } + + /** + * Indicates whether to add the MCC acronym to the merchant name for Prosa acquirer in Mexico. + * When set to **true**, the MCC acronym is automatically appended to the merchant name. Default: + * **false**. + * + * @param addMccAcronym Indicates whether to add the MCC acronym to the merchant name for Prosa + * acquirer in Mexico. When set to **true**, the MCC acronym is automatically appended to the + * merchant name. Default: **false**. + */ + @JsonProperty(JSON_PROPERTY_ADD_MCC_ACRONYM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddMccAcronym(Boolean addMccAcronym) { + this.addMccAcronym = addMccAcronym; + isSetAddMccAcronym = true; // mark as set + } + + /** + * transactionDescription + * + * @param transactionDescription + * @return the current {@code CarnetInfo} instance, allowing for method chaining + */ + public CarnetInfo transactionDescription(TransactionDescriptionInfo transactionDescription) { + this.transactionDescription = transactionDescription; + isSetTransactionDescription = true; // mark as set + return this; + } + + /** + * Get transactionDescription + * + * @return transactionDescription + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TransactionDescriptionInfo getTransactionDescription() { + return transactionDescription; + } + + /** + * transactionDescription + * + * @param transactionDescription + */ + @JsonProperty(JSON_PROPERTY_TRANSACTION_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransactionDescription(TransactionDescriptionInfo transactionDescription) { + this.transactionDescription = transactionDescription; + isSetTransactionDescription = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CarnetInfo 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 CarnetInfo object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CarnetInfo carnetInfo = (CarnetInfo) o; + return Objects.equals(this.addMccAcronym, carnetInfo.addMccAcronym) + && Objects.equals(this.isSetAddMccAcronym, carnetInfo.isSetAddMccAcronym) + && Objects.equals(this.transactionDescription, carnetInfo.transactionDescription) + && Objects.equals(this.isSetTransactionDescription, carnetInfo.isSetTransactionDescription); + } + + @Override + public int hashCode() { + return Objects.hash( + addMccAcronym, isSetAddMccAcronym, transactionDescription, isSetTransactionDescription); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CarnetInfo {\n"); + sb.append(" addMccAcronym: ").append(toIndentedString(addMccAcronym)).append("\n"); + sb.append(" transactionDescription: ") + .append(toIndentedString(transactionDescription)) + .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 (isSetAddMccAcronym) { + addIfNull(nulls, JSON_PROPERTY_ADD_MCC_ACRONYM, this.addMccAcronym); + } + if (isSetTransactionDescription) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_DESCRIPTION, this.transactionDescription); + } + + 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 CarnetInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CarnetInfo + * @throws JsonProcessingException if the JSON string is invalid with respect to CarnetInfo + */ + public static CarnetInfo fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CarnetInfo.class); + } + + /** + * Convert an instance of CarnetInfo 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/management/CashAppUpdateInfo.java b/src/main/java/com/adyen/model/management/CashAppUpdateInfo.java new file mode 100644 index 000000000..a32774bfe --- /dev/null +++ b/src/main/java/com/adyen/model/management/CashAppUpdateInfo.java @@ -0,0 +1,225 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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.*; + +/** CashAppUpdateInfo */ +@JsonPropertyOrder({ + CashAppUpdateInfo.JSON_PROPERTY_LOGO_URL, + CashAppUpdateInfo.JSON_PROPERTY_MERCHANT_NAME +}) +public class CashAppUpdateInfo { + public static final String JSON_PROPERTY_LOGO_URL = "logoUrl"; + private String logoUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoUrl = false; + + public static final String JSON_PROPERTY_MERCHANT_NAME = "merchantName"; + private String merchantName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CashAppUpdateInfo() {} + + /** + * The URL of the logo image shown in Cash App checkout next to payments. + * + * @param logoUrl The URL of the logo image shown in Cash App checkout next to payments. + * @return the current {@code CashAppUpdateInfo} instance, allowing for method chaining + */ + public CashAppUpdateInfo logoUrl(String logoUrl) { + this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set + return this; + } + + /** + * The URL of the logo image shown in Cash App checkout next to payments. + * + * @return logoUrl The URL of the logo image shown in Cash App checkout next to payments. + */ + @JsonProperty(JSON_PROPERTY_LOGO_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogoUrl() { + return logoUrl; + } + + /** + * The URL of the logo image shown in Cash App checkout next to payments. + * + * @param logoUrl The URL of the logo image shown in Cash App checkout next to payments. + */ + @JsonProperty(JSON_PROPERTY_LOGO_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set + } + + /** + * The merchant display name shown in Cash App checkout. + * + * @param merchantName The merchant display name shown in Cash App checkout. + * @return the current {@code CashAppUpdateInfo} instance, allowing for method chaining + */ + public CashAppUpdateInfo merchantName(String merchantName) { + this.merchantName = merchantName; + isSetMerchantName = true; // mark as set + return this; + } + + /** + * The merchant display name shown in Cash App checkout. + * + * @return merchantName The merchant display name shown in Cash App checkout. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMerchantName() { + return merchantName; + } + + /** + * The merchant display name shown in Cash App checkout. + * + * @param merchantName The merchant display name shown in Cash App checkout. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantName(String merchantName) { + this.merchantName = merchantName; + isSetMerchantName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CashAppUpdateInfo 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 CashAppUpdateInfo object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CashAppUpdateInfo cashAppUpdateInfo = (CashAppUpdateInfo) o; + return Objects.equals(this.logoUrl, cashAppUpdateInfo.logoUrl) + && Objects.equals(this.isSetLogoUrl, cashAppUpdateInfo.isSetLogoUrl) + && Objects.equals(this.merchantName, cashAppUpdateInfo.merchantName) + && Objects.equals(this.isSetMerchantName, cashAppUpdateInfo.isSetMerchantName); + } + + @Override + public int hashCode() { + return Objects.hash(logoUrl, isSetLogoUrl, merchantName, isSetMerchantName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CashAppUpdateInfo {\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" merchantName: ").append(toIndentedString(merchantName)).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 (isSetLogoUrl) { + addIfNull(nulls, JSON_PROPERTY_LOGO_URL, this.logoUrl); + } + if (isSetMerchantName) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAME, this.merchantName); + } + + 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 CashAppUpdateInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CashAppUpdateInfo + * @throws JsonProcessingException if the JSON string is invalid with respect to CashAppUpdateInfo + */ + public static CashAppUpdateInfo fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CashAppUpdateInfo.class); + } + + /** + * Convert an instance of CashAppUpdateInfo 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/management/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/management/DefaultErrorResponseEntity.java new file mode 100644 index 000000000..88e1c23f2 --- /dev/null +++ b/src/main/java/com/adyen/model/management/DefaultErrorResponseEntity.java @@ -0,0 +1,547 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** Standardized error response following RFC-7807 format */ +@JsonPropertyOrder({ + DefaultErrorResponseEntity.JSON_PROPERTY_DETAIL, + DefaultErrorResponseEntity.JSON_PROPERTY_ERROR_CODE, + DefaultErrorResponseEntity.JSON_PROPERTY_INSTANCE, + DefaultErrorResponseEntity.JSON_PROPERTY_INVALID_FIELDS, + DefaultErrorResponseEntity.JSON_PROPERTY_REQUEST_ID, + DefaultErrorResponseEntity.JSON_PROPERTY_STATUS, + DefaultErrorResponseEntity.JSON_PROPERTY_TITLE, + DefaultErrorResponseEntity.JSON_PROPERTY_TYPE +}) +public class DefaultErrorResponseEntity { + public static final String JSON_PROPERTY_DETAIL = "detail"; + private String detail; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; + private String errorCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + + public static final String JSON_PROPERTY_INSTANCE = "instance"; + private String instance; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; + private List invalidFields; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; + private String requestId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Integer status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DefaultErrorResponseEntity() {} + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity detail(String detail) { + this.detail = detail; + isSetDetail = true; // mark as set + return this; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @return detail A human-readable explanation specific to this occurrence of the problem. + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetail() { + return detail; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(String detail) { + this.detail = detail; + isSetDetail = true; // mark as set + } + + /** + * Unique business error code. + * + * @param errorCode Unique business error code. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity errorCode(String errorCode) { + this.errorCode = errorCode; + isSetErrorCode = true; // mark as set + return this; + } + + /** + * Unique business error code. + * + * @return errorCode Unique business error code. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorCode() { + return errorCode; + } + + /** + * Unique business error code. + * + * @param errorCode Unique business error code. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + isSetErrorCode = true; // mark as set + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @param instance A URI that identifies the specific occurrence of the problem if applicable. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity instance(String instance) { + this.instance = instance; + isSetInstance = true; // mark as set + return this; + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @return instance A URI that identifies the specific occurrence of the problem if applicable. + */ + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstance() { + return instance; + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @param instance A URI that identifies the specific occurrence of the problem if applicable. + */ + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstance(String instance) { + this.instance = instance; + isSetInstance = true; // mark as set + } + + /** + * Array of fields with validation errors when applicable. + * + * @param invalidFields Array of fields with validation errors when applicable. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity invalidFields(List invalidFields) { + this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set + return this; + } + + public DefaultErrorResponseEntity addInvalidFieldsItem(InvalidField invalidFieldsItem) { + if (this.invalidFields == null) { + this.invalidFields = new ArrayList<>(); + } + this.invalidFields.add(invalidFieldsItem); + return this; + } + + /** + * Array of fields with validation errors when applicable. + * + * @return invalidFields Array of fields with validation errors when applicable. + */ + @JsonProperty(JSON_PROPERTY_INVALID_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInvalidFields() { + return invalidFields; + } + + /** + * Array of fields with validation errors when applicable. + * + * @param invalidFields Array of fields with validation errors when applicable. + */ + @JsonProperty(JSON_PROPERTY_INVALID_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvalidFields(List invalidFields) { + this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set + } + + /** + * The unique reference for the request. + * + * @param requestId The unique reference for the request. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity requestId(String requestId) { + this.requestId = requestId; + isSetRequestId = true; // mark as set + return this; + } + + /** + * The unique reference for the request. + * + * @return requestId The unique reference for the request. + */ + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestId() { + return requestId; + } + + /** + * The unique reference for the request. + * + * @param requestId The unique reference for the request. + */ + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestId(String requestId) { + this.requestId = requestId; + isSetRequestId = true; // mark as set + } + + /** + * The HTTP status code. + * + * @param status The HTTP status code. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity status(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * The HTTP status code. + * + * @return status The HTTP status code. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStatus() { + return status; + } + + /** + * The HTTP status code. + * + * @param status The HTTP status code. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * A short, human-readable summary of the problem type. + * + * @param title A short, human-readable summary of the problem type. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity title(String title) { + this.title = title; + isSetTitle = true; // mark as set + return this; + } + + /** + * A short, human-readable summary of the problem type. + * + * @return title A short, human-readable summary of the problem type. + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + /** + * A short, human-readable summary of the problem type. + * + * @param title A short, human-readable summary of the problem type. + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + isSetTitle = true; // mark as set + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @param type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @return type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @param type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DefaultErrorResponseEntity object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultErrorResponseEntity defaultErrorResponseEntity = (DefaultErrorResponseEntity) o; + return Objects.equals(this.detail, defaultErrorResponseEntity.detail) + && Objects.equals(this.isSetDetail, defaultErrorResponseEntity.isSetDetail) + && Objects.equals(this.errorCode, defaultErrorResponseEntity.errorCode) + && Objects.equals(this.isSetErrorCode, defaultErrorResponseEntity.isSetErrorCode) + && Objects.equals(this.instance, defaultErrorResponseEntity.instance) + && Objects.equals(this.isSetInstance, defaultErrorResponseEntity.isSetInstance) + && Objects.equals(this.invalidFields, defaultErrorResponseEntity.invalidFields) + && Objects.equals(this.isSetInvalidFields, defaultErrorResponseEntity.isSetInvalidFields) + && Objects.equals(this.requestId, defaultErrorResponseEntity.requestId) + && Objects.equals(this.isSetRequestId, defaultErrorResponseEntity.isSetRequestId) + && Objects.equals(this.status, defaultErrorResponseEntity.status) + && Objects.equals(this.isSetStatus, defaultErrorResponseEntity.isSetStatus) + && Objects.equals(this.title, defaultErrorResponseEntity.title) + && Objects.equals(this.isSetTitle, defaultErrorResponseEntity.isSetTitle) + && Objects.equals(this.type, defaultErrorResponseEntity.type) + && Objects.equals(this.isSetType, defaultErrorResponseEntity.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash( + detail, + isSetDetail, + errorCode, + isSetErrorCode, + instance, + isSetInstance, + invalidFields, + isSetInvalidFields, + requestId, + isSetRequestId, + status, + isSetStatus, + title, + isSetTitle, + type, + isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultErrorResponseEntity {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" invalidFields: ").append(toIndentedString(invalidFields)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DefaultErrorResponseEntity given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultErrorResponseEntity + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DefaultErrorResponseEntity + */ + public static DefaultErrorResponseEntity fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DefaultErrorResponseEntity.class); + } + + /** + * Convert an instance of DefaultErrorResponseEntity to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/management/DisplayTextField.java b/src/main/java/com/adyen/model/management/DisplayTextField.java new file mode 100644 index 000000000..acbb07e03 --- /dev/null +++ b/src/main/java/com/adyen/model/management/DisplayTextField.java @@ -0,0 +1,58 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; +import java.util.logging.Logger; + +/** Gets or Sets DisplayTextField */ +public enum DisplayTextField { + CAUSENAME("causeName"), + + NONPROFITNAME("nonprofitName"); + + private static final Logger LOG = Logger.getLogger(DisplayTextField.class.getName()); + + private String value; + + DisplayTextField(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DisplayTextField fromValue(String value) { + for (DisplayTextField b : DisplayTextField.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "DisplayTextField: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(DisplayTextField.values())); + return null; + } +} diff --git a/src/main/java/com/adyen/model/management/DonationAmount.java b/src/main/java/com/adyen/model/management/DonationAmount.java new file mode 100644 index 000000000..0bfa60172 --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationAmount.java @@ -0,0 +1,247 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** DonationAmount */ +@JsonPropertyOrder({ + DonationAmount.JSON_PROPERTY_AMOUNTS, + DonationAmount.JSON_PROPERTY_CURRENCY_CODE +}) +public class DonationAmount { + public static final String JSON_PROPERTY_AMOUNTS = "amounts"; + private List amounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmounts = false; + + public static final String JSON_PROPERTY_CURRENCY_CODE = "currencyCode"; + private String currencyCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrencyCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DonationAmount() {} + + /** + * The donation amounts in minor units. The list must contain at least one amount and no more than + * three amounts. + * + * @param amounts The donation amounts in minor units. The list must contain at least one amount + * and no more than three amounts. + * @return the current {@code DonationAmount} instance, allowing for method chaining + */ + public DonationAmount amounts(List amounts) { + this.amounts = amounts; + isSetAmounts = true; // mark as set + return this; + } + + public DonationAmount addAmountsItem(Long amountsItem) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.add(amountsItem); + return this; + } + + /** + * The donation amounts in minor units. The list must contain at least one amount and no more than + * three amounts. + * + * @return amounts The donation amounts in minor units. The list must contain at least one amount + * and no more than three amounts. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAmounts() { + return amounts; + } + + /** + * The donation amounts in minor units. The list must contain at least one amount and no more than + * three amounts. + * + * @param amounts The donation amounts in minor units. The list must contain at least one amount + * and no more than three amounts. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmounts(List amounts) { + this.amounts = amounts; + isSetAmounts = true; // mark as set + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param currencyCode The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * @return the current {@code DonationAmount} instance, allowing for method chaining + */ + public DonationAmount currencyCode(String currencyCode) { + this.currencyCode = currencyCode; + isSetCurrencyCode = true; // mark as set + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @return currencyCode The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrencyCode() { + return currencyCode; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param currencyCode The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + isSetCurrencyCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationAmount 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 DonationAmount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DonationAmount donationAmount = (DonationAmount) o; + return Objects.equals(this.amounts, donationAmount.amounts) + && Objects.equals(this.isSetAmounts, donationAmount.isSetAmounts) + && Objects.equals(this.currencyCode, donationAmount.currencyCode) + && Objects.equals(this.isSetCurrencyCode, donationAmount.isSetCurrencyCode); + } + + @Override + public int hashCode() { + return Objects.hash(amounts, isSetAmounts, currencyCode, isSetCurrencyCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DonationAmount {\n"); + sb.append(" amounts: ").append(toIndentedString(amounts)).append("\n"); + sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).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 (isSetAmounts) { + addIfNull(nulls, JSON_PROPERTY_AMOUNTS, this.amounts); + } + if (isSetCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY_CODE, this.currencyCode); + } + + 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 DonationAmount given an JSON string + * + * @param jsonString JSON string + * @return An instance of DonationAmount + * @throws JsonProcessingException if the JSON string is invalid with respect to DonationAmount + */ + public static DonationAmount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DonationAmount.class); + } + + /** + * Convert an instance of DonationAmount 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/management/DonationAmountUpdate.java b/src/main/java/com/adyen/model/management/DonationAmountUpdate.java new file mode 100644 index 000000000..094a56f2e --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationAmountUpdate.java @@ -0,0 +1,248 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** DonationAmountUpdate */ +@JsonPropertyOrder({ + DonationAmountUpdate.JSON_PROPERTY_AMOUNTS, + DonationAmountUpdate.JSON_PROPERTY_CURRENCY_CODE +}) +public class DonationAmountUpdate { + public static final String JSON_PROPERTY_AMOUNTS = "amounts"; + private List amounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmounts = false; + + public static final String JSON_PROPERTY_CURRENCY_CODE = "currencyCode"; + private String currencyCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrencyCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DonationAmountUpdate() {} + + /** + * The donation amounts in minor units. The list must contain at least one amount and no more than + * three amounts. + * + * @param amounts The donation amounts in minor units. The list must contain at least one amount + * and no more than three amounts. + * @return the current {@code DonationAmountUpdate} instance, allowing for method chaining + */ + public DonationAmountUpdate amounts(List amounts) { + this.amounts = amounts; + isSetAmounts = true; // mark as set + return this; + } + + public DonationAmountUpdate addAmountsItem(Long amountsItem) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.add(amountsItem); + return this; + } + + /** + * The donation amounts in minor units. The list must contain at least one amount and no more than + * three amounts. + * + * @return amounts The donation amounts in minor units. The list must contain at least one amount + * and no more than three amounts. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAmounts() { + return amounts; + } + + /** + * The donation amounts in minor units. The list must contain at least one amount and no more than + * three amounts. + * + * @param amounts The donation amounts in minor units. The list must contain at least one amount + * and no more than three amounts. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmounts(List amounts) { + this.amounts = amounts; + isSetAmounts = true; // mark as set + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param currencyCode The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * @return the current {@code DonationAmountUpdate} instance, allowing for method chaining + */ + public DonationAmountUpdate currencyCode(String currencyCode) { + this.currencyCode = currencyCode; + isSetCurrencyCode = true; // mark as set + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @return currencyCode The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrencyCode() { + return currencyCode; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param currencyCode The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_CURRENCY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + isSetCurrencyCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationAmountUpdate 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 DonationAmountUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DonationAmountUpdate donationAmountUpdate = (DonationAmountUpdate) o; + return Objects.equals(this.amounts, donationAmountUpdate.amounts) + && Objects.equals(this.isSetAmounts, donationAmountUpdate.isSetAmounts) + && Objects.equals(this.currencyCode, donationAmountUpdate.currencyCode) + && Objects.equals(this.isSetCurrencyCode, donationAmountUpdate.isSetCurrencyCode); + } + + @Override + public int hashCode() { + return Objects.hash(amounts, isSetAmounts, currencyCode, isSetCurrencyCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DonationAmountUpdate {\n"); + sb.append(" amounts: ").append(toIndentedString(amounts)).append("\n"); + sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).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 (isSetAmounts) { + addIfNull(nulls, JSON_PROPERTY_AMOUNTS, this.amounts); + } + if (isSetCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY_CODE, this.currencyCode); + } + + 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 DonationAmountUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of DonationAmountUpdate + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DonationAmountUpdate + */ + public static DonationAmountUpdate fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DonationAmountUpdate.class); + } + + /** + * Convert an instance of DonationAmountUpdate 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/management/DonationCampaign.java b/src/main/java/com/adyen/model/management/DonationCampaign.java new file mode 100644 index 000000000..e67f5aa9c --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationCampaign.java @@ -0,0 +1,541 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** DonationCampaign */ +@JsonPropertyOrder({ + DonationCampaign.JSON_PROPERTY_ACCOUNT_HOLDER_IDS, + DonationCampaign.JSON_PROPERTY_ACTIVATED_AT, + DonationCampaign.JSON_PROPERTY_ENDED_AT, + DonationCampaign.JSON_PROPERTY_ID, + DonationCampaign.JSON_PROPERTY_IN_PERSON, + DonationCampaign.JSON_PROPERTY_NAME, + DonationCampaign.JSON_PROPERTY_NONPROFIT_CAUSE, + DonationCampaign.JSON_PROPERTY_ONLINE, + DonationCampaign.JSON_PROPERTY_STATUS +}) +public class DonationCampaign { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_IDS = "accountHolderIds"; + private List accountHolderIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderIds = false; + + public static final String JSON_PROPERTY_ACTIVATED_AT = "activatedAt"; + private OffsetDateTime activatedAt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActivatedAt = false; + + public static final String JSON_PROPERTY_ENDED_AT = "endedAt"; + private OffsetDateTime endedAt; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndedAt = 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_IN_PERSON = "inPerson"; + private InPersonDonationSettingsResponse inPerson; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInPerson = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + public static final String JSON_PROPERTY_NONPROFIT_CAUSE = "nonprofitCause"; + private DonationCampaignNonprofitCause nonprofitCause; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitCause = false; + + public static final String JSON_PROPERTY_ONLINE = "online"; + private OnlineDonationSettingsResponse online; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOnline = false; + + public static final String JSON_PROPERTY_STATUS = "status"; + private DonationCampaignStatus status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DonationCampaign() {} + + @JsonCreator + public DonationCampaign( + @JsonProperty(JSON_PROPERTY_ACTIVATED_AT) OffsetDateTime activatedAt, + @JsonProperty(JSON_PROPERTY_ENDED_AT) OffsetDateTime endedAt, + @JsonProperty(JSON_PROPERTY_ID) String id) { + this(); + this.activatedAt = activatedAt; + this.endedAt = endedAt; + this.id = id; + } + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @param accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + * @return the current {@code DonationCampaign} instance, allowing for method chaining + */ + public DonationCampaign accountHolderIds(List accountHolderIds) { + this.accountHolderIds = accountHolderIds; + isSetAccountHolderIds = true; // mark as set + return this; + } + + public DonationCampaign addAccountHolderIdsItem(String accountHolderIdsItem) { + if (this.accountHolderIds == null) { + this.accountHolderIds = new ArrayList<>(); + } + this.accountHolderIds.add(accountHolderIdsItem); + return this; + } + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @return accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccountHolderIds() { + return accountHolderIds; + } + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @param accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolderIds(List accountHolderIds) { + this.accountHolderIds = accountHolderIds; + isSetAccountHolderIds = true; // mark as set + } + + /** + * The date and time when the campaign started, in [ISO + * 8601](https://en.wikipedia.org/wiki/ISO_8601) format. For example, + * 2026-06-18T10:28:59.820+00:00 + * + * @return activatedAt The date and time when the campaign started, in [ISO + * 8601](https://en.wikipedia.org/wiki/ISO_8601) format. For example, + * 2026-06-18T10:28:59.820+00:00 + */ + @JsonProperty(JSON_PROPERTY_ACTIVATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getActivatedAt() { + return activatedAt; + } + + /** + * The date and time when the campaign stopped, in [ISO + * 8601](https://en.wikipedia.org/wiki/ISO_8601) format. For example, + * 2026-06-18T10:28:59.820+00:00. + * + * @return endedAt The date and time when the campaign stopped, in [ISO + * 8601](https://en.wikipedia.org/wiki/ISO_8601) format. For example, + * 2026-06-18T10:28:59.820+00:00. + */ + @JsonProperty(JSON_PROPERTY_ENDED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getEndedAt() { + return endedAt; + } + + /** + * The unique identifier of the donation campaign. This value is generated by Adyen. + * + * @return id The unique identifier of the donation campaign. This value is generated by Adyen. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * inPerson + * + * @param inPerson + * @return the current {@code DonationCampaign} instance, allowing for method chaining + */ + public DonationCampaign inPerson(InPersonDonationSettingsResponse inPerson) { + this.inPerson = inPerson; + isSetInPerson = true; // mark as set + return this; + } + + /** + * Get inPerson + * + * @return inPerson + */ + @JsonProperty(JSON_PROPERTY_IN_PERSON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InPersonDonationSettingsResponse getInPerson() { + return inPerson; + } + + /** + * inPerson + * + * @param inPerson + */ + @JsonProperty(JSON_PROPERTY_IN_PERSON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInPerson(InPersonDonationSettingsResponse inPerson) { + this.inPerson = inPerson; + isSetInPerson = true; // mark as set + } + + /** + * The name of the donation campaign. + * + * @param name The name of the donation campaign. + * @return the current {@code DonationCampaign} instance, allowing for method chaining + */ + public DonationCampaign name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The name of the donation campaign. + * + * @return name The name of the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The name of the donation campaign. + * + * @param name The name of the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set + } + + /** + * nonprofitCause + * + * @param nonprofitCause + * @return the current {@code DonationCampaign} instance, allowing for method chaining + */ + public DonationCampaign nonprofitCause(DonationCampaignNonprofitCause nonprofitCause) { + this.nonprofitCause = nonprofitCause; + isSetNonprofitCause = true; // mark as set + return this; + } + + /** + * Get nonprofitCause + * + * @return nonprofitCause + */ + @JsonProperty(JSON_PROPERTY_NONPROFIT_CAUSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationCampaignNonprofitCause getNonprofitCause() { + return nonprofitCause; + } + + /** + * nonprofitCause + * + * @param nonprofitCause + */ + @JsonProperty(JSON_PROPERTY_NONPROFIT_CAUSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNonprofitCause(DonationCampaignNonprofitCause nonprofitCause) { + this.nonprofitCause = nonprofitCause; + isSetNonprofitCause = true; // mark as set + } + + /** + * online + * + * @param online + * @return the current {@code DonationCampaign} instance, allowing for method chaining + */ + public DonationCampaign online(OnlineDonationSettingsResponse online) { + this.online = online; + isSetOnline = true; // mark as set + return this; + } + + /** + * Get online + * + * @return online + */ + @JsonProperty(JSON_PROPERTY_ONLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnlineDonationSettingsResponse getOnline() { + return online; + } + + /** + * online + * + * @param online + */ + @JsonProperty(JSON_PROPERTY_ONLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOnline(OnlineDonationSettingsResponse online) { + this.online = online; + isSetOnline = true; // mark as set + } + + /** + * status + * + * @param status + * @return the current {@code DonationCampaign} instance, allowing for method chaining + */ + public DonationCampaign status(DonationCampaignStatus status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * Get status + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationCampaignStatus getStatus() { + return status; + } + + /** + * status + * + * @param status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(DonationCampaignStatus status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaign 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 DonationCampaign object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DonationCampaign donationCampaign = (DonationCampaign) o; + return Objects.equals(this.accountHolderIds, donationCampaign.accountHolderIds) + && Objects.equals(this.isSetAccountHolderIds, donationCampaign.isSetAccountHolderIds) + && Objects.equals(this.activatedAt, donationCampaign.activatedAt) + && Objects.equals(this.isSetActivatedAt, donationCampaign.isSetActivatedAt) + && Objects.equals(this.endedAt, donationCampaign.endedAt) + && Objects.equals(this.isSetEndedAt, donationCampaign.isSetEndedAt) + && Objects.equals(this.id, donationCampaign.id) + && Objects.equals(this.isSetId, donationCampaign.isSetId) + && Objects.equals(this.inPerson, donationCampaign.inPerson) + && Objects.equals(this.isSetInPerson, donationCampaign.isSetInPerson) + && Objects.equals(this.name, donationCampaign.name) + && Objects.equals(this.isSetName, donationCampaign.isSetName) + && Objects.equals(this.nonprofitCause, donationCampaign.nonprofitCause) + && Objects.equals(this.isSetNonprofitCause, donationCampaign.isSetNonprofitCause) + && Objects.equals(this.online, donationCampaign.online) + && Objects.equals(this.isSetOnline, donationCampaign.isSetOnline) + && Objects.equals(this.status, donationCampaign.status) + && Objects.equals(this.isSetStatus, donationCampaign.isSetStatus); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolderIds, + isSetAccountHolderIds, + activatedAt, + isSetActivatedAt, + endedAt, + isSetEndedAt, + id, + isSetId, + inPerson, + isSetInPerson, + name, + isSetName, + nonprofitCause, + isSetNonprofitCause, + online, + isSetOnline, + status, + isSetStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DonationCampaign {\n"); + sb.append(" accountHolderIds: ").append(toIndentedString(accountHolderIds)).append("\n"); + sb.append(" activatedAt: ").append(toIndentedString(activatedAt)).append("\n"); + sb.append(" endedAt: ").append(toIndentedString(endedAt)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" inPerson: ").append(toIndentedString(inPerson)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nonprofitCause: ").append(toIndentedString(nonprofitCause)).append("\n"); + sb.append(" online: ").append(toIndentedString(online)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderIds) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_IDS, this.accountHolderIds); + } + if (isSetActivatedAt) { + addIfNull(nulls, JSON_PROPERTY_ACTIVATED_AT, this.activatedAt); + } + if (isSetEndedAt) { + addIfNull(nulls, JSON_PROPERTY_ENDED_AT, this.endedAt); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInPerson) { + addIfNull(nulls, JSON_PROPERTY_IN_PERSON, this.inPerson); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNonprofitCause) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_CAUSE, this.nonprofitCause); + } + if (isSetOnline) { + addIfNull(nulls, JSON_PROPERTY_ONLINE, this.online); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DonationCampaign given an JSON string + * + * @param jsonString JSON string + * @return An instance of DonationCampaign + * @throws JsonProcessingException if the JSON string is invalid with respect to DonationCampaign + */ + public static DonationCampaign fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DonationCampaign.class); + } + + /** + * Convert an instance of DonationCampaign 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/management/DonationCampaignNonprofitCause.java b/src/main/java/com/adyen/model/management/DonationCampaignNonprofitCause.java new file mode 100644 index 000000000..1227d15ab --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationCampaignNonprofitCause.java @@ -0,0 +1,573 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** DonationCampaignNonprofitCause */ +@JsonPropertyOrder({ + DonationCampaignNonprofitCause.JSON_PROPERTY_BANNER_URL, + DonationCampaignNonprofitCause.JSON_PROPERTY_CAUSE_ID, + DonationCampaignNonprofitCause.JSON_PROPERTY_DESCRIPTION, + DonationCampaignNonprofitCause.JSON_PROPERTY_GLOBAL_WEBSITE_URL, + DonationCampaignNonprofitCause.JSON_PROPERTY_GOALS, + DonationCampaignNonprofitCause.JSON_PROPERTY_LOGO_URL, + DonationCampaignNonprofitCause.JSON_PROPERTY_NONPROFIT_NAME, + DonationCampaignNonprofitCause.JSON_PROPERTY_TERMS_AND_CONDITIONS_URL +}) +public class DonationCampaignNonprofitCause { + public static final String JSON_PROPERTY_BANNER_URL = "bannerUrl"; + private String bannerUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBannerUrl = false; + + public static final String JSON_PROPERTY_CAUSE_ID = "causeId"; + private String causeId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCauseId = 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_GLOBAL_WEBSITE_URL = "globalWebsiteUrl"; + private String globalWebsiteUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGlobalWebsiteUrl = false; + + public static final String JSON_PROPERTY_GOALS = "goals"; + private List goals; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGoals = false; + + public static final String JSON_PROPERTY_LOGO_URL = "logoUrl"; + private String logoUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoUrl = false; + + public static final String JSON_PROPERTY_NONPROFIT_NAME = "nonprofitName"; + private String nonprofitName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitName = false; + + public static final String JSON_PROPERTY_TERMS_AND_CONDITIONS_URL = "termsAndConditionsUrl"; + private String termsAndConditionsUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsAndConditionsUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DonationCampaignNonprofitCause() {} + + /** + * The URL to the banner showing the cause that the nonprofit organization supports. + * + * @param bannerUrl The URL to the banner showing the cause that the nonprofit organization + * supports. + * @return the current {@code DonationCampaignNonprofitCause} instance, allowing for method + * chaining + */ + public DonationCampaignNonprofitCause bannerUrl(String bannerUrl) { + this.bannerUrl = bannerUrl; + isSetBannerUrl = true; // mark as set + return this; + } + + /** + * The URL to the banner showing the cause that the nonprofit organization supports. + * + * @return bannerUrl The URL to the banner showing the cause that the nonprofit organization + * supports. + */ + @JsonProperty(JSON_PROPERTY_BANNER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBannerUrl() { + return bannerUrl; + } + + /** + * The URL to the banner showing the cause that the nonprofit organization supports. + * + * @param bannerUrl The URL to the banner showing the cause that the nonprofit organization + * supports. + */ + @JsonProperty(JSON_PROPERTY_BANNER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBannerUrl(String bannerUrl) { + this.bannerUrl = bannerUrl; + isSetBannerUrl = true; // mark as set + } + + /** + * The unique identifier of the nonprofit cause. This value is generated by Adyen. + * + * @param causeId The unique identifier of the nonprofit cause. This value is generated by Adyen. + * @return the current {@code DonationCampaignNonprofitCause} instance, allowing for method + * chaining + */ + public DonationCampaignNonprofitCause causeId(String causeId) { + this.causeId = causeId; + isSetCauseId = true; // mark as set + return this; + } + + /** + * The unique identifier of the nonprofit cause. This value is generated by Adyen. + * + * @return causeId The unique identifier of the nonprofit cause. This value is generated by Adyen. + */ + @JsonProperty(JSON_PROPERTY_CAUSE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCauseId() { + return causeId; + } + + /** + * The unique identifier of the nonprofit cause. This value is generated by Adyen. + * + * @param causeId The unique identifier of the nonprofit cause. This value is generated by Adyen. + */ + @JsonProperty(JSON_PROPERTY_CAUSE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCauseId(String causeId) { + this.causeId = causeId; + isSetCauseId = true; // mark as set + } + + /** + * The description of the cause that the nonprofit supports. + * + * @param description The description of the cause that the nonprofit supports. + * @return the current {@code DonationCampaignNonprofitCause} instance, allowing for method + * chaining + */ + public DonationCampaignNonprofitCause description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * The description of the cause that the nonprofit supports. + * + * @return description The description of the cause that the nonprofit supports. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * The description of the cause that the nonprofit supports. + * + * @param description The description of the cause that the nonprofit supports. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * The URL to the website of the nonprofit organization. + * + * @param globalWebsiteUrl The URL to the website of the nonprofit organization. + * @return the current {@code DonationCampaignNonprofitCause} instance, allowing for method + * chaining + */ + public DonationCampaignNonprofitCause globalWebsiteUrl(String globalWebsiteUrl) { + this.globalWebsiteUrl = globalWebsiteUrl; + isSetGlobalWebsiteUrl = true; // mark as set + return this; + } + + /** + * The URL to the website of the nonprofit organization. + * + * @return globalWebsiteUrl The URL to the website of the nonprofit organization. + */ + @JsonProperty(JSON_PROPERTY_GLOBAL_WEBSITE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGlobalWebsiteUrl() { + return globalWebsiteUrl; + } + + /** + * The URL to the website of the nonprofit organization. + * + * @param globalWebsiteUrl The URL to the website of the nonprofit organization. + */ + @JsonProperty(JSON_PROPERTY_GLOBAL_WEBSITE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGlobalWebsiteUrl(String globalWebsiteUrl) { + this.globalWebsiteUrl = globalWebsiteUrl; + isSetGlobalWebsiteUrl = true; // mark as set + } + + /** + * The United Nations Sustainable Development Goals (UN SDGs) supported by the nonprofit + * organization, specified in the format `unsdg_<number>`, where the number is the + * number of the UN SDG. For example, **unsdg_1**. + * + * @param goals The United Nations Sustainable Development Goals (UN SDGs) supported by the + * nonprofit organization, specified in the format `unsdg_<number>`, where the + * number is the number of the UN SDG. For example, **unsdg_1**. + * @return the current {@code DonationCampaignNonprofitCause} instance, allowing for method + * chaining + */ + public DonationCampaignNonprofitCause goals(List goals) { + this.goals = goals; + isSetGoals = true; // mark as set + return this; + } + + public DonationCampaignNonprofitCause addGoalsItem(String goalsItem) { + if (this.goals == null) { + this.goals = new ArrayList<>(); + } + this.goals.add(goalsItem); + return this; + } + + /** + * The United Nations Sustainable Development Goals (UN SDGs) supported by the nonprofit + * organization, specified in the format `unsdg_<number>`, where the number is the + * number of the UN SDG. For example, **unsdg_1**. + * + * @return goals The United Nations Sustainable Development Goals (UN SDGs) supported by the + * nonprofit organization, specified in the format `unsdg_<number>`, where the + * number is the number of the UN SDG. For example, **unsdg_1**. + */ + @JsonProperty(JSON_PROPERTY_GOALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGoals() { + return goals; + } + + /** + * The United Nations Sustainable Development Goals (UN SDGs) supported by the nonprofit + * organization, specified in the format `unsdg_<number>`, where the number is the + * number of the UN SDG. For example, **unsdg_1**. + * + * @param goals The United Nations Sustainable Development Goals (UN SDGs) supported by the + * nonprofit organization, specified in the format `unsdg_<number>`, where the + * number is the number of the UN SDG. For example, **unsdg_1**. + */ + @JsonProperty(JSON_PROPERTY_GOALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGoals(List goals) { + this.goals = goals; + isSetGoals = true; // mark as set + } + + /** + * The URL to the logo of the nonprofit organization. + * + * @param logoUrl The URL to the logo of the nonprofit organization. + * @return the current {@code DonationCampaignNonprofitCause} instance, allowing for method + * chaining + */ + public DonationCampaignNonprofitCause logoUrl(String logoUrl) { + this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set + return this; + } + + /** + * The URL to the logo of the nonprofit organization. + * + * @return logoUrl The URL to the logo of the nonprofit organization. + */ + @JsonProperty(JSON_PROPERTY_LOGO_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogoUrl() { + return logoUrl; + } + + /** + * The URL to the logo of the nonprofit organization. + * + * @param logoUrl The URL to the logo of the nonprofit organization. + */ + @JsonProperty(JSON_PROPERTY_LOGO_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set + } + + /** + * The name of the nonprofit organization. + * + * @param nonprofitName The name of the nonprofit organization. + * @return the current {@code DonationCampaignNonprofitCause} instance, allowing for method + * chaining + */ + public DonationCampaignNonprofitCause nonprofitName(String nonprofitName) { + this.nonprofitName = nonprofitName; + isSetNonprofitName = true; // mark as set + return this; + } + + /** + * The name of the nonprofit organization. + * + * @return nonprofitName The name of the nonprofit organization. + */ + @JsonProperty(JSON_PROPERTY_NONPROFIT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNonprofitName() { + return nonprofitName; + } + + /** + * The name of the nonprofit organization. + * + * @param nonprofitName The name of the nonprofit organization. + */ + @JsonProperty(JSON_PROPERTY_NONPROFIT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNonprofitName(String nonprofitName) { + this.nonprofitName = nonprofitName; + isSetNonprofitName = true; // mark as set + } + + /** + * The URL to the terms and conditions of the nonprofit organization. + * + * @param termsAndConditionsUrl The URL to the terms and conditions of the nonprofit organization. + * @return the current {@code DonationCampaignNonprofitCause} instance, allowing for method + * chaining + */ + public DonationCampaignNonprofitCause termsAndConditionsUrl(String termsAndConditionsUrl) { + this.termsAndConditionsUrl = termsAndConditionsUrl; + isSetTermsAndConditionsUrl = true; // mark as set + return this; + } + + /** + * The URL to the terms and conditions of the nonprofit organization. + * + * @return termsAndConditionsUrl The URL to the terms and conditions of the nonprofit + * organization. + */ + @JsonProperty(JSON_PROPERTY_TERMS_AND_CONDITIONS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTermsAndConditionsUrl() { + return termsAndConditionsUrl; + } + + /** + * The URL to the terms and conditions of the nonprofit organization. + * + * @param termsAndConditionsUrl The URL to the terms and conditions of the nonprofit organization. + */ + @JsonProperty(JSON_PROPERTY_TERMS_AND_CONDITIONS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTermsAndConditionsUrl(String termsAndConditionsUrl) { + this.termsAndConditionsUrl = termsAndConditionsUrl; + isSetTermsAndConditionsUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaignNonprofitCause 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 DonationCampaignNonprofitCause object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DonationCampaignNonprofitCause donationCampaignNonprofitCause = + (DonationCampaignNonprofitCause) o; + return Objects.equals(this.bannerUrl, donationCampaignNonprofitCause.bannerUrl) + && Objects.equals(this.isSetBannerUrl, donationCampaignNonprofitCause.isSetBannerUrl) + && Objects.equals(this.causeId, donationCampaignNonprofitCause.causeId) + && Objects.equals(this.isSetCauseId, donationCampaignNonprofitCause.isSetCauseId) + && Objects.equals(this.description, donationCampaignNonprofitCause.description) + && Objects.equals(this.isSetDescription, donationCampaignNonprofitCause.isSetDescription) + && Objects.equals(this.globalWebsiteUrl, donationCampaignNonprofitCause.globalWebsiteUrl) + && Objects.equals( + this.isSetGlobalWebsiteUrl, donationCampaignNonprofitCause.isSetGlobalWebsiteUrl) + && Objects.equals(this.goals, donationCampaignNonprofitCause.goals) + && Objects.equals(this.isSetGoals, donationCampaignNonprofitCause.isSetGoals) + && Objects.equals(this.logoUrl, donationCampaignNonprofitCause.logoUrl) + && Objects.equals(this.isSetLogoUrl, donationCampaignNonprofitCause.isSetLogoUrl) + && Objects.equals(this.nonprofitName, donationCampaignNonprofitCause.nonprofitName) + && Objects.equals( + this.isSetNonprofitName, donationCampaignNonprofitCause.isSetNonprofitName) + && Objects.equals( + this.termsAndConditionsUrl, donationCampaignNonprofitCause.termsAndConditionsUrl) + && Objects.equals( + this.isSetTermsAndConditionsUrl, + donationCampaignNonprofitCause.isSetTermsAndConditionsUrl); + } + + @Override + public int hashCode() { + return Objects.hash( + bannerUrl, + isSetBannerUrl, + causeId, + isSetCauseId, + description, + isSetDescription, + globalWebsiteUrl, + isSetGlobalWebsiteUrl, + goals, + isSetGoals, + logoUrl, + isSetLogoUrl, + nonprofitName, + isSetNonprofitName, + termsAndConditionsUrl, + isSetTermsAndConditionsUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DonationCampaignNonprofitCause {\n"); + sb.append(" bannerUrl: ").append(toIndentedString(bannerUrl)).append("\n"); + sb.append(" causeId: ").append(toIndentedString(causeId)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" globalWebsiteUrl: ").append(toIndentedString(globalWebsiteUrl)).append("\n"); + sb.append(" goals: ").append(toIndentedString(goals)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" nonprofitName: ").append(toIndentedString(nonprofitName)).append("\n"); + sb.append(" termsAndConditionsUrl: ") + .append(toIndentedString(termsAndConditionsUrl)) + .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 (isSetBannerUrl) { + addIfNull(nulls, JSON_PROPERTY_BANNER_URL, this.bannerUrl); + } + if (isSetCauseId) { + addIfNull(nulls, JSON_PROPERTY_CAUSE_ID, this.causeId); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetGlobalWebsiteUrl) { + addIfNull(nulls, JSON_PROPERTY_GLOBAL_WEBSITE_URL, this.globalWebsiteUrl); + } + if (isSetGoals) { + addIfNull(nulls, JSON_PROPERTY_GOALS, this.goals); + } + if (isSetLogoUrl) { + addIfNull(nulls, JSON_PROPERTY_LOGO_URL, this.logoUrl); + } + if (isSetNonprofitName) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_NAME, this.nonprofitName); + } + if (isSetTermsAndConditionsUrl) { + addIfNull(nulls, JSON_PROPERTY_TERMS_AND_CONDITIONS_URL, this.termsAndConditionsUrl); + } + + 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 DonationCampaignNonprofitCause given an JSON string + * + * @param jsonString JSON string + * @return An instance of DonationCampaignNonprofitCause + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DonationCampaignNonprofitCause + */ + public static DonationCampaignNonprofitCause fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DonationCampaignNonprofitCause.class); + } + + /** + * Convert an instance of DonationCampaignNonprofitCause 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/management/DonationCampaignRequest.java b/src/main/java/com/adyen/model/management/DonationCampaignRequest.java new file mode 100644 index 000000000..3b204a23d --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationCampaignRequest.java @@ -0,0 +1,396 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** DonationCampaignRequest */ +@JsonPropertyOrder({ + DonationCampaignRequest.JSON_PROPERTY_ACCOUNT_HOLDER_IDS, + DonationCampaignRequest.JSON_PROPERTY_IN_PERSON, + DonationCampaignRequest.JSON_PROPERTY_NAME, + DonationCampaignRequest.JSON_PROPERTY_NONPROFIT_CAUSE_ID, + DonationCampaignRequest.JSON_PROPERTY_ONLINE +}) +public class DonationCampaignRequest { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_IDS = "accountHolderIds"; + private List accountHolderIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderIds = false; + + public static final String JSON_PROPERTY_IN_PERSON = "inPerson"; + private InPersonDonationSettings inPerson; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInPerson = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + public static final String JSON_PROPERTY_NONPROFIT_CAUSE_ID = "nonprofitCauseId"; + private String nonprofitCauseId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitCauseId = false; + + public static final String JSON_PROPERTY_ONLINE = "online"; + private OnlineDonationSettings online; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOnline = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DonationCampaignRequest() {} + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @param accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + * @return the current {@code DonationCampaignRequest} instance, allowing for method chaining + */ + public DonationCampaignRequest accountHolderIds(List accountHolderIds) { + this.accountHolderIds = accountHolderIds; + isSetAccountHolderIds = true; // mark as set + return this; + } + + public DonationCampaignRequest addAccountHolderIdsItem(String accountHolderIdsItem) { + if (this.accountHolderIds == null) { + this.accountHolderIds = new ArrayList<>(); + } + this.accountHolderIds.add(accountHolderIdsItem); + return this; + } + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @return accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccountHolderIds() { + return accountHolderIds; + } + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @param accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolderIds(List accountHolderIds) { + this.accountHolderIds = accountHolderIds; + isSetAccountHolderIds = true; // mark as set + } + + /** + * inPerson + * + * @param inPerson + * @return the current {@code DonationCampaignRequest} instance, allowing for method chaining + */ + public DonationCampaignRequest inPerson(InPersonDonationSettings inPerson) { + this.inPerson = inPerson; + isSetInPerson = true; // mark as set + return this; + } + + /** + * Get inPerson + * + * @return inPerson + */ + @JsonProperty(JSON_PROPERTY_IN_PERSON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InPersonDonationSettings getInPerson() { + return inPerson; + } + + /** + * inPerson + * + * @param inPerson + */ + @JsonProperty(JSON_PROPERTY_IN_PERSON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInPerson(InPersonDonationSettings inPerson) { + this.inPerson = inPerson; + isSetInPerson = true; // mark as set + } + + /** + * The name of the donation campaign. + * + * @param name The name of the donation campaign. + * @return the current {@code DonationCampaignRequest} instance, allowing for method chaining + */ + public DonationCampaignRequest name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The name of the donation campaign. + * + * @return name The name of the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The name of the donation campaign. + * + * @param name The name of the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set + } + + /** + * The unique identifier of the nonprofit cause that the campaign supports. + * + * @param nonprofitCauseId The unique identifier of the nonprofit cause that the campaign + * supports. + * @return the current {@code DonationCampaignRequest} instance, allowing for method chaining + */ + public DonationCampaignRequest nonprofitCauseId(String nonprofitCauseId) { + this.nonprofitCauseId = nonprofitCauseId; + isSetNonprofitCauseId = true; // mark as set + return this; + } + + /** + * The unique identifier of the nonprofit cause that the campaign supports. + * + * @return nonprofitCauseId The unique identifier of the nonprofit cause that the campaign + * supports. + */ + @JsonProperty(JSON_PROPERTY_NONPROFIT_CAUSE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNonprofitCauseId() { + return nonprofitCauseId; + } + + /** + * The unique identifier of the nonprofit cause that the campaign supports. + * + * @param nonprofitCauseId The unique identifier of the nonprofit cause that the campaign + * supports. + */ + @JsonProperty(JSON_PROPERTY_NONPROFIT_CAUSE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNonprofitCauseId(String nonprofitCauseId) { + this.nonprofitCauseId = nonprofitCauseId; + isSetNonprofitCauseId = true; // mark as set + } + + /** + * online + * + * @param online + * @return the current {@code DonationCampaignRequest} instance, allowing for method chaining + */ + public DonationCampaignRequest online(OnlineDonationSettings online) { + this.online = online; + isSetOnline = true; // mark as set + return this; + } + + /** + * Get online + * + * @return online + */ + @JsonProperty(JSON_PROPERTY_ONLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnlineDonationSettings getOnline() { + return online; + } + + /** + * online + * + * @param online + */ + @JsonProperty(JSON_PROPERTY_ONLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOnline(OnlineDonationSettings online) { + this.online = online; + isSetOnline = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaignRequest 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 DonationCampaignRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DonationCampaignRequest donationCampaignRequest = (DonationCampaignRequest) o; + return Objects.equals(this.accountHolderIds, donationCampaignRequest.accountHolderIds) + && Objects.equals(this.isSetAccountHolderIds, donationCampaignRequest.isSetAccountHolderIds) + && Objects.equals(this.inPerson, donationCampaignRequest.inPerson) + && Objects.equals(this.isSetInPerson, donationCampaignRequest.isSetInPerson) + && Objects.equals(this.name, donationCampaignRequest.name) + && Objects.equals(this.isSetName, donationCampaignRequest.isSetName) + && Objects.equals(this.nonprofitCauseId, donationCampaignRequest.nonprofitCauseId) + && Objects.equals(this.isSetNonprofitCauseId, donationCampaignRequest.isSetNonprofitCauseId) + && Objects.equals(this.online, donationCampaignRequest.online) + && Objects.equals(this.isSetOnline, donationCampaignRequest.isSetOnline); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolderIds, + isSetAccountHolderIds, + inPerson, + isSetInPerson, + name, + isSetName, + nonprofitCauseId, + isSetNonprofitCauseId, + online, + isSetOnline); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DonationCampaignRequest {\n"); + sb.append(" accountHolderIds: ").append(toIndentedString(accountHolderIds)).append("\n"); + sb.append(" inPerson: ").append(toIndentedString(inPerson)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nonprofitCauseId: ").append(toIndentedString(nonprofitCauseId)).append("\n"); + sb.append(" online: ").append(toIndentedString(online)).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 (isSetAccountHolderIds) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_IDS, this.accountHolderIds); + } + if (isSetInPerson) { + addIfNull(nulls, JSON_PROPERTY_IN_PERSON, this.inPerson); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNonprofitCauseId) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_CAUSE_ID, this.nonprofitCauseId); + } + if (isSetOnline) { + addIfNull(nulls, JSON_PROPERTY_ONLINE, this.online); + } + + 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 DonationCampaignRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DonationCampaignRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DonationCampaignRequest + */ + public static DonationCampaignRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DonationCampaignRequest.class); + } + + /** + * Convert an instance of DonationCampaignRequest 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/management/DonationCampaignStatus.java b/src/main/java/com/adyen/model/management/DonationCampaignStatus.java new file mode 100644 index 000000000..f3521bc30 --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationCampaignStatus.java @@ -0,0 +1,60 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; +import java.util.logging.Logger; + +/** Gets or Sets DonationCampaignStatus */ +public enum DonationCampaignStatus { + ACTIVE("active"), + + INACTIVE("inactive"), + + ENDED("ended"); + + private static final Logger LOG = Logger.getLogger(DonationCampaignStatus.class.getName()); + + private String value; + + DonationCampaignStatus(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DonationCampaignStatus fromValue(String value) { + for (DonationCampaignStatus b : DonationCampaignStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "DonationCampaignStatus: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(DonationCampaignStatus.values())); + return null; + } +} diff --git a/src/main/java/com/adyen/model/management/DonationCampaignUpdate.java b/src/main/java/com/adyen/model/management/DonationCampaignUpdate.java new file mode 100644 index 000000000..ece23c099 --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationCampaignUpdate.java @@ -0,0 +1,343 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** DonationCampaignUpdate */ +@JsonPropertyOrder({ + DonationCampaignUpdate.JSON_PROPERTY_ACCOUNT_HOLDER_IDS, + DonationCampaignUpdate.JSON_PROPERTY_IN_PERSON, + DonationCampaignUpdate.JSON_PROPERTY_NAME, + DonationCampaignUpdate.JSON_PROPERTY_ONLINE +}) +public class DonationCampaignUpdate { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_IDS = "accountHolderIds"; + private List accountHolderIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderIds = false; + + public static final String JSON_PROPERTY_IN_PERSON = "inPerson"; + private InPersonDonationSettingsUpdate inPerson; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInPerson = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + public static final String JSON_PROPERTY_ONLINE = "online"; + private OnlineDonationSettingsUpdate online; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOnline = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DonationCampaignUpdate() {} + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @param accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + * @return the current {@code DonationCampaignUpdate} instance, allowing for method chaining + */ + public DonationCampaignUpdate accountHolderIds(List accountHolderIds) { + this.accountHolderIds = accountHolderIds; + isSetAccountHolderIds = true; // mark as set + return this; + } + + public DonationCampaignUpdate addAccountHolderIdsItem(String accountHolderIdsItem) { + if (this.accountHolderIds == null) { + this.accountHolderIds = new ArrayList<>(); + } + this.accountHolderIds.add(accountHolderIdsItem); + return this; + } + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @return accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccountHolderIds() { + return accountHolderIds; + } + + /** + * The unique identifiers of the account holders associated with the donation campaign. + * + * @param accountHolderIds The unique identifiers of the account holders associated with the + * donation campaign. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolderIds(List accountHolderIds) { + this.accountHolderIds = accountHolderIds; + isSetAccountHolderIds = true; // mark as set + } + + /** + * inPerson + * + * @param inPerson + * @return the current {@code DonationCampaignUpdate} instance, allowing for method chaining + */ + public DonationCampaignUpdate inPerson(InPersonDonationSettingsUpdate inPerson) { + this.inPerson = inPerson; + isSetInPerson = true; // mark as set + return this; + } + + /** + * Get inPerson + * + * @return inPerson + */ + @JsonProperty(JSON_PROPERTY_IN_PERSON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InPersonDonationSettingsUpdate getInPerson() { + return inPerson; + } + + /** + * inPerson + * + * @param inPerson + */ + @JsonProperty(JSON_PROPERTY_IN_PERSON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInPerson(InPersonDonationSettingsUpdate inPerson) { + this.inPerson = inPerson; + isSetInPerson = true; // mark as set + } + + /** + * The name of the donation campaign. + * + * @param name The name of the donation campaign. + * @return the current {@code DonationCampaignUpdate} instance, allowing for method chaining + */ + public DonationCampaignUpdate name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The name of the donation campaign. + * + * @return name The name of the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The name of the donation campaign. + * + * @param name The name of the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set + } + + /** + * online + * + * @param online + * @return the current {@code DonationCampaignUpdate} instance, allowing for method chaining + */ + public DonationCampaignUpdate online(OnlineDonationSettingsUpdate online) { + this.online = online; + isSetOnline = true; // mark as set + return this; + } + + /** + * Get online + * + * @return online + */ + @JsonProperty(JSON_PROPERTY_ONLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnlineDonationSettingsUpdate getOnline() { + return online; + } + + /** + * online + * + * @param online + */ + @JsonProperty(JSON_PROPERTY_ONLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOnline(OnlineDonationSettingsUpdate online) { + this.online = online; + isSetOnline = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaignUpdate 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 DonationCampaignUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DonationCampaignUpdate donationCampaignUpdate = (DonationCampaignUpdate) o; + return Objects.equals(this.accountHolderIds, donationCampaignUpdate.accountHolderIds) + && Objects.equals(this.isSetAccountHolderIds, donationCampaignUpdate.isSetAccountHolderIds) + && Objects.equals(this.inPerson, donationCampaignUpdate.inPerson) + && Objects.equals(this.isSetInPerson, donationCampaignUpdate.isSetInPerson) + && Objects.equals(this.name, donationCampaignUpdate.name) + && Objects.equals(this.isSetName, donationCampaignUpdate.isSetName) + && Objects.equals(this.online, donationCampaignUpdate.online) + && Objects.equals(this.isSetOnline, donationCampaignUpdate.isSetOnline); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolderIds, + isSetAccountHolderIds, + inPerson, + isSetInPerson, + name, + isSetName, + online, + isSetOnline); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DonationCampaignUpdate {\n"); + sb.append(" accountHolderIds: ").append(toIndentedString(accountHolderIds)).append("\n"); + sb.append(" inPerson: ").append(toIndentedString(inPerson)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" online: ").append(toIndentedString(online)).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 (isSetAccountHolderIds) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_IDS, this.accountHolderIds); + } + if (isSetInPerson) { + addIfNull(nulls, JSON_PROPERTY_IN_PERSON, this.inPerson); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetOnline) { + addIfNull(nulls, JSON_PROPERTY_ONLINE, this.online); + } + + 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 DonationCampaignUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of DonationCampaignUpdate + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DonationCampaignUpdate + */ + public static DonationCampaignUpdate fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DonationCampaignUpdate.class); + } + + /** + * Convert an instance of DonationCampaignUpdate 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/management/DonationFlow.java b/src/main/java/com/adyen/model/management/DonationFlow.java new file mode 100644 index 000000000..de4a38184 --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationFlow.java @@ -0,0 +1,58 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; +import java.util.logging.Logger; + +/** Gets or Sets DonationFlow */ +public enum DonationFlow { + ONESTEP("oneStep"), + + TWOSTEP("twoStep"); + + private static final Logger LOG = Logger.getLogger(DonationFlow.class.getName()); + + private String value; + + DonationFlow(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DonationFlow fromValue(String value) { + for (DonationFlow b : DonationFlow.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "DonationFlow: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(DonationFlow.values())); + return null; + } +} diff --git a/src/main/java/com/adyen/model/management/DonationType.java b/src/main/java/com/adyen/model/management/DonationType.java new file mode 100644 index 000000000..6baee4d35 --- /dev/null +++ b/src/main/java/com/adyen/model/management/DonationType.java @@ -0,0 +1,60 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.*; +import java.util.logging.Logger; + +/** Gets or Sets DonationType */ +public enum DonationType { + ROUNDUP("roundup"), + + FIXEDAMOUNTS("fixedAmounts"), + + FIXEDAMOUNTSROUNDUP("fixedAmountsRoundup"); + + private static final Logger LOG = Logger.getLogger(DonationType.class.getName()); + + private String value; + + DonationType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DonationType fromValue(String value) { + for (DonationType b : DonationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "DonationType: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(DonationType.values())); + return null; + } +} diff --git a/src/main/java/com/adyen/model/management/InPersonDonationSettings.java b/src/main/java/com/adyen/model/management/InPersonDonationSettings.java new file mode 100644 index 000000000..7e0192209 --- /dev/null +++ b/src/main/java/com/adyen/model/management/InPersonDonationSettings.java @@ -0,0 +1,584 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** InPersonDonationSettings */ +@JsonPropertyOrder({ + InPersonDonationSettings.JSON_PROPERTY_DEFAULT_AMOUNT, + InPersonDonationSettings.JSON_PROPERTY_DISPLAY_TEXT_FIELD, + InPersonDonationSettings.JSON_PROPERTY_DONATION_FLOW, + InPersonDonationSettings.JSON_PROPERTY_DONATION_TYPE, + InPersonDonationSettings.JSON_PROPERTY_MERCHANT_ACCOUNTS, + InPersonDonationSettings.JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS, + InPersonDonationSettings.JSON_PROPERTY_PROMPT_TIMEOUT_MS, + InPersonDonationSettings.JSON_PROPERTY_STORE_IDS +}) +public class InPersonDonationSettings { + public static final String JSON_PROPERTY_DEFAULT_AMOUNT = "defaultAmount"; + private DonationAmount defaultAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultAmount = false; + + public static final String JSON_PROPERTY_DISPLAY_TEXT_FIELD = "displayTextField"; + private DisplayTextField displayTextField; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayTextField = false; + + public static final String JSON_PROPERTY_DONATION_FLOW = "donationFlow"; + private DonationFlow donationFlow; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationFlow = false; + + public static final String JSON_PROPERTY_DONATION_TYPE = "donationType"; + private DonationType donationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationType = false; + + public static final String JSON_PROPERTY_MERCHANT_ACCOUNTS = "merchantAccounts"; + private List merchantAccounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccounts = false; + + public static final String JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS = "presentCardTimeoutMs"; + private Long presentCardTimeoutMs; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPresentCardTimeoutMs = false; + + public static final String JSON_PROPERTY_PROMPT_TIMEOUT_MS = "promptTimeoutMs"; + private Long promptTimeoutMs; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPromptTimeoutMs = false; + + public static final String JSON_PROPERTY_STORE_IDS = "storeIds"; + private List storeIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InPersonDonationSettings() {} + + /** + * defaultAmount + * + * @param defaultAmount + * @return the current {@code InPersonDonationSettings} instance, allowing for method chaining + */ + public InPersonDonationSettings defaultAmount(DonationAmount defaultAmount) { + this.defaultAmount = defaultAmount; + isSetDefaultAmount = true; // mark as set + return this; + } + + /** + * Get defaultAmount + * + * @return defaultAmount + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationAmount getDefaultAmount() { + return defaultAmount; + } + + /** + * defaultAmount + * + * @param defaultAmount + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultAmount(DonationAmount defaultAmount) { + this.defaultAmount = defaultAmount; + isSetDefaultAmount = true; // mark as set + } + + /** + * displayTextField + * + * @param displayTextField + * @return the current {@code InPersonDonationSettings} instance, allowing for method chaining + */ + public InPersonDonationSettings displayTextField(DisplayTextField displayTextField) { + this.displayTextField = displayTextField; + isSetDisplayTextField = true; // mark as set + return this; + } + + /** + * Get displayTextField + * + * @return displayTextField + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_TEXT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisplayTextField getDisplayTextField() { + return displayTextField; + } + + /** + * displayTextField + * + * @param displayTextField + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_TEXT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayTextField(DisplayTextField displayTextField) { + this.displayTextField = displayTextField; + isSetDisplayTextField = true; // mark as set + } + + /** + * donationFlow + * + * @param donationFlow + * @return the current {@code InPersonDonationSettings} instance, allowing for method chaining + */ + public InPersonDonationSettings donationFlow(DonationFlow donationFlow) { + this.donationFlow = donationFlow; + isSetDonationFlow = true; // mark as set + return this; + } + + /** + * Get donationFlow + * + * @return donationFlow + */ + @JsonProperty(JSON_PROPERTY_DONATION_FLOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationFlow getDonationFlow() { + return donationFlow; + } + + /** + * donationFlow + * + * @param donationFlow + */ + @JsonProperty(JSON_PROPERTY_DONATION_FLOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationFlow(DonationFlow donationFlow) { + this.donationFlow = donationFlow; + isSetDonationFlow = true; // mark as set + } + + /** + * donationType + * + * @param donationType + * @return the current {@code InPersonDonationSettings} instance, allowing for method chaining + */ + public InPersonDonationSettings donationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + return this; + } + + /** + * Get donationType + * + * @return donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationType getDonationType() { + return donationType; + } + + /** + * donationType + * + * @param donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + * @return the current {@code InPersonDonationSettings} instance, allowing for method chaining + */ + public InPersonDonationSettings merchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + return this; + } + + public InPersonDonationSettings addMerchantAccountsItem(String merchantAccountsItem) { + if (this.merchantAccounts == null) { + this.merchantAccounts = new ArrayList<>(); + } + this.merchantAccounts.add(merchantAccountsItem); + return this; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @return merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMerchantAccounts() { + return merchantAccounts; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + } + + /** + * Required if `donationFlow` is set to **twoStep**. The time, in milliseconds, that the + * terminal waits for the shopper to present their card. Defaults to **10000** (10 seconds). + * Range: 5000 to 15000. + * + * @param presentCardTimeoutMs Required if `donationFlow` is set to **twoStep**. The + * time, in milliseconds, that the terminal waits for the shopper to present their card. + * Defaults to **10000** (10 seconds). Range: 5000 to 15000. + * @return the current {@code InPersonDonationSettings} instance, allowing for method chaining + */ + public InPersonDonationSettings presentCardTimeoutMs(Long presentCardTimeoutMs) { + this.presentCardTimeoutMs = presentCardTimeoutMs; + isSetPresentCardTimeoutMs = true; // mark as set + return this; + } + + /** + * Required if `donationFlow` is set to **twoStep**. The time, in milliseconds, that the + * terminal waits for the shopper to present their card. Defaults to **10000** (10 seconds). + * Range: 5000 to 15000. + * + * @return presentCardTimeoutMs Required if `donationFlow` is set to **twoStep**. The + * time, in milliseconds, that the terminal waits for the shopper to present their card. + * Defaults to **10000** (10 seconds). Range: 5000 to 15000. + */ + @JsonProperty(JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPresentCardTimeoutMs() { + return presentCardTimeoutMs; + } + + /** + * Required if `donationFlow` is set to **twoStep**. The time, in milliseconds, that the + * terminal waits for the shopper to present their card. Defaults to **10000** (10 seconds). + * Range: 5000 to 15000. + * + * @param presentCardTimeoutMs Required if `donationFlow` is set to **twoStep**. The + * time, in milliseconds, that the terminal waits for the shopper to present their card. + * Defaults to **10000** (10 seconds). Range: 5000 to 15000. + */ + @JsonProperty(JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPresentCardTimeoutMs(Long presentCardTimeoutMs) { + this.presentCardTimeoutMs = presentCardTimeoutMs; + isSetPresentCardTimeoutMs = true; // mark as set + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to make a selection on the + * donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000. + * + * @param promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to + * 15000. + * @return the current {@code InPersonDonationSettings} instance, allowing for method chaining + */ + public InPersonDonationSettings promptTimeoutMs(Long promptTimeoutMs) { + this.promptTimeoutMs = promptTimeoutMs; + isSetPromptTimeoutMs = true; // mark as set + return this; + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to make a selection on the + * donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000. + * + * @return promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to + * 15000. + */ + @JsonProperty(JSON_PROPERTY_PROMPT_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPromptTimeoutMs() { + return promptTimeoutMs; + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to make a selection on the + * donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000. + * + * @param promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to + * 15000. + */ + @JsonProperty(JSON_PROPERTY_PROMPT_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPromptTimeoutMs(Long promptTimeoutMs) { + this.promptTimeoutMs = promptTimeoutMs; + isSetPromptTimeoutMs = true; // mark as set + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + * @return the current {@code InPersonDonationSettings} instance, allowing for method chaining + */ + public InPersonDonationSettings storeIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + return this; + } + + public InPersonDonationSettings addStoreIdsItem(String storeIdsItem) { + if (this.storeIds == null) { + this.storeIds = new ArrayList<>(); + } + this.storeIds.add(storeIdsItem); + return this; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @return storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStoreIds() { + return storeIds; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoreIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InPersonDonationSettings 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 InPersonDonationSettings object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InPersonDonationSettings inPersonDonationSettings = (InPersonDonationSettings) o; + return Objects.equals(this.defaultAmount, inPersonDonationSettings.defaultAmount) + && Objects.equals(this.isSetDefaultAmount, inPersonDonationSettings.isSetDefaultAmount) + && Objects.equals(this.displayTextField, inPersonDonationSettings.displayTextField) + && Objects.equals( + this.isSetDisplayTextField, inPersonDonationSettings.isSetDisplayTextField) + && Objects.equals(this.donationFlow, inPersonDonationSettings.donationFlow) + && Objects.equals(this.isSetDonationFlow, inPersonDonationSettings.isSetDonationFlow) + && Objects.equals(this.donationType, inPersonDonationSettings.donationType) + && Objects.equals(this.isSetDonationType, inPersonDonationSettings.isSetDonationType) + && Objects.equals(this.merchantAccounts, inPersonDonationSettings.merchantAccounts) + && Objects.equals( + this.isSetMerchantAccounts, inPersonDonationSettings.isSetMerchantAccounts) + && Objects.equals(this.presentCardTimeoutMs, inPersonDonationSettings.presentCardTimeoutMs) + && Objects.equals( + this.isSetPresentCardTimeoutMs, inPersonDonationSettings.isSetPresentCardTimeoutMs) + && Objects.equals(this.promptTimeoutMs, inPersonDonationSettings.promptTimeoutMs) + && Objects.equals(this.isSetPromptTimeoutMs, inPersonDonationSettings.isSetPromptTimeoutMs) + && Objects.equals(this.storeIds, inPersonDonationSettings.storeIds) + && Objects.equals(this.isSetStoreIds, inPersonDonationSettings.isSetStoreIds); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultAmount, + isSetDefaultAmount, + displayTextField, + isSetDisplayTextField, + donationFlow, + isSetDonationFlow, + donationType, + isSetDonationType, + merchantAccounts, + isSetMerchantAccounts, + presentCardTimeoutMs, + isSetPresentCardTimeoutMs, + promptTimeoutMs, + isSetPromptTimeoutMs, + storeIds, + isSetStoreIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InPersonDonationSettings {\n"); + sb.append(" defaultAmount: ").append(toIndentedString(defaultAmount)).append("\n"); + sb.append(" displayTextField: ").append(toIndentedString(displayTextField)).append("\n"); + sb.append(" donationFlow: ").append(toIndentedString(donationFlow)).append("\n"); + sb.append(" donationType: ").append(toIndentedString(donationType)).append("\n"); + sb.append(" merchantAccounts: ").append(toIndentedString(merchantAccounts)).append("\n"); + sb.append(" presentCardTimeoutMs: ") + .append(toIndentedString(presentCardTimeoutMs)) + .append("\n"); + sb.append(" promptTimeoutMs: ").append(toIndentedString(promptTimeoutMs)).append("\n"); + sb.append(" storeIds: ").append(toIndentedString(storeIds)).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 (isSetDefaultAmount) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_AMOUNT, this.defaultAmount); + } + if (isSetDisplayTextField) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_TEXT_FIELD, this.displayTextField); + } + if (isSetDonationFlow) { + addIfNull(nulls, JSON_PROPERTY_DONATION_FLOW, this.donationFlow); + } + if (isSetDonationType) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TYPE, this.donationType); + } + if (isSetMerchantAccounts) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNTS, this.merchantAccounts); + } + if (isSetPresentCardTimeoutMs) { + addIfNull(nulls, JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS, this.presentCardTimeoutMs); + } + if (isSetPromptTimeoutMs) { + addIfNull(nulls, JSON_PROPERTY_PROMPT_TIMEOUT_MS, this.promptTimeoutMs); + } + if (isSetStoreIds) { + addIfNull(nulls, JSON_PROPERTY_STORE_IDS, this.storeIds); + } + + 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 InPersonDonationSettings given an JSON string + * + * @param jsonString JSON string + * @return An instance of InPersonDonationSettings + * @throws JsonProcessingException if the JSON string is invalid with respect to + * InPersonDonationSettings + */ + public static InPersonDonationSettings fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InPersonDonationSettings.class); + } + + /** + * Convert an instance of InPersonDonationSettings 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/management/InPersonDonationSettingsResponse.java b/src/main/java/com/adyen/model/management/InPersonDonationSettingsResponse.java new file mode 100644 index 000000000..f49b26785 --- /dev/null +++ b/src/main/java/com/adyen/model/management/InPersonDonationSettingsResponse.java @@ -0,0 +1,667 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** InPersonDonationSettingsResponse */ +@JsonPropertyOrder({ + InPersonDonationSettingsResponse.JSON_PROPERTY_AMOUNTS, + InPersonDonationSettingsResponse.JSON_PROPERTY_DEFAULT_CURRENCY, + InPersonDonationSettingsResponse.JSON_PROPERTY_DISPLAY_TEXT_FIELD, + InPersonDonationSettingsResponse.JSON_PROPERTY_DONATION_FLOW, + InPersonDonationSettingsResponse.JSON_PROPERTY_DONATION_TYPE, + InPersonDonationSettingsResponse.JSON_PROPERTY_MERCHANT_ACCOUNTS, + InPersonDonationSettingsResponse.JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS, + InPersonDonationSettingsResponse.JSON_PROPERTY_PROMPT_TIMEOUT_MS, + InPersonDonationSettingsResponse.JSON_PROPERTY_STORE_IDS +}) +public class InPersonDonationSettingsResponse { + public static final String JSON_PROPERTY_AMOUNTS = "amounts"; + private List amounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmounts = false; + + public static final String JSON_PROPERTY_DEFAULT_CURRENCY = "defaultCurrency"; + private String defaultCurrency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrency = false; + + public static final String JSON_PROPERTY_DISPLAY_TEXT_FIELD = "displayTextField"; + private DisplayTextField displayTextField; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayTextField = false; + + public static final String JSON_PROPERTY_DONATION_FLOW = "donationFlow"; + private DonationFlow donationFlow; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationFlow = false; + + public static final String JSON_PROPERTY_DONATION_TYPE = "donationType"; + private DonationType donationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationType = false; + + public static final String JSON_PROPERTY_MERCHANT_ACCOUNTS = "merchantAccounts"; + private List merchantAccounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccounts = false; + + public static final String JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS = "presentCardTimeoutMs"; + private Long presentCardTimeoutMs; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPresentCardTimeoutMs = false; + + public static final String JSON_PROPERTY_PROMPT_TIMEOUT_MS = "promptTimeoutMs"; + private Long promptTimeoutMs; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPromptTimeoutMs = false; + + public static final String JSON_PROPERTY_STORE_IDS = "storeIds"; + private List storeIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InPersonDonationSettingsResponse() {} + + /** + * The currency and fixed amounts for donations. We automatically add calculated amounts in other + * currencies for participating stores that use a different currency than the default. + * + * @param amounts The currency and fixed amounts for donations. We automatically add calculated + * amounts in other currencies for participating stores that use a different currency than the + * default. + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse amounts(List amounts) { + this.amounts = amounts; + isSetAmounts = true; // mark as set + return this; + } + + public InPersonDonationSettingsResponse addAmountsItem(DonationAmount amountsItem) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.add(amountsItem); + return this; + } + + /** + * The currency and fixed amounts for donations. We automatically add calculated amounts in other + * currencies for participating stores that use a different currency than the default. + * + * @return amounts The currency and fixed amounts for donations. We automatically add calculated + * amounts in other currencies for participating stores that use a different currency than the + * default. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAmounts() { + return amounts; + } + + /** + * The currency and fixed amounts for donations. We automatically add calculated amounts in other + * currencies for participating stores that use a different currency than the default. + * + * @param amounts The currency and fixed amounts for donations. We automatically add calculated + * amounts in other currencies for participating stores that use a different currency than the + * default. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmounts(List amounts) { + this.amounts = amounts; + isSetAmounts = true; // mark as set + } + + /** + * The currency that was used in the request to set fixed donation amounts. Format: + * three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param defaultCurrency The currency that was used in the request to set fixed donation amounts. + * Format: three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse defaultCurrency(String defaultCurrency) { + this.defaultCurrency = defaultCurrency; + isSetDefaultCurrency = true; // mark as set + return this; + } + + /** + * The currency that was used in the request to set fixed donation amounts. Format: + * three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @return defaultCurrency The currency that was used in the request to set fixed donation + * amounts. Format: three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultCurrency() { + return defaultCurrency; + } + + /** + * The currency that was used in the request to set fixed donation amounts. Format: + * three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param defaultCurrency The currency that was used in the request to set fixed donation amounts. + * Format: three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultCurrency(String defaultCurrency) { + this.defaultCurrency = defaultCurrency; + isSetDefaultCurrency = true; // mark as set + } + + /** + * displayTextField + * + * @param displayTextField + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse displayTextField(DisplayTextField displayTextField) { + this.displayTextField = displayTextField; + isSetDisplayTextField = true; // mark as set + return this; + } + + /** + * Get displayTextField + * + * @return displayTextField + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_TEXT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisplayTextField getDisplayTextField() { + return displayTextField; + } + + /** + * displayTextField + * + * @param displayTextField + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_TEXT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayTextField(DisplayTextField displayTextField) { + this.displayTextField = displayTextField; + isSetDisplayTextField = true; // mark as set + } + + /** + * donationFlow + * + * @param donationFlow + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse donationFlow(DonationFlow donationFlow) { + this.donationFlow = donationFlow; + isSetDonationFlow = true; // mark as set + return this; + } + + /** + * Get donationFlow + * + * @return donationFlow + */ + @JsonProperty(JSON_PROPERTY_DONATION_FLOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationFlow getDonationFlow() { + return donationFlow; + } + + /** + * donationFlow + * + * @param donationFlow + */ + @JsonProperty(JSON_PROPERTY_DONATION_FLOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationFlow(DonationFlow donationFlow) { + this.donationFlow = donationFlow; + isSetDonationFlow = true; // mark as set + } + + /** + * donationType + * + * @param donationType + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse donationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + return this; + } + + /** + * Get donationType + * + * @return donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationType getDonationType() { + return donationType; + } + + /** + * donationType + * + * @param donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse merchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + return this; + } + + public InPersonDonationSettingsResponse addMerchantAccountsItem(String merchantAccountsItem) { + if (this.merchantAccounts == null) { + this.merchantAccounts = new ArrayList<>(); + } + this.merchantAccounts.add(merchantAccountsItem); + return this; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @return merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMerchantAccounts() { + return merchantAccounts; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to present their card. + * + * @param presentCardTimeoutMs The time, in milliseconds, that the terminal waits for the shopper + * to present their card. + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse presentCardTimeoutMs(Long presentCardTimeoutMs) { + this.presentCardTimeoutMs = presentCardTimeoutMs; + isSetPresentCardTimeoutMs = true; // mark as set + return this; + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to present their card. + * + * @return presentCardTimeoutMs The time, in milliseconds, that the terminal waits for the shopper + * to present their card. + */ + @JsonProperty(JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPresentCardTimeoutMs() { + return presentCardTimeoutMs; + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to present their card. + * + * @param presentCardTimeoutMs The time, in milliseconds, that the terminal waits for the shopper + * to present their card. + */ + @JsonProperty(JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPresentCardTimeoutMs(Long presentCardTimeoutMs) { + this.presentCardTimeoutMs = presentCardTimeoutMs; + isSetPresentCardTimeoutMs = true; // mark as set + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to respond to the text + * asking for a donation. + * + * @param promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * respond to the text asking for a donation. + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse promptTimeoutMs(Long promptTimeoutMs) { + this.promptTimeoutMs = promptTimeoutMs; + isSetPromptTimeoutMs = true; // mark as set + return this; + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to respond to the text + * asking for a donation. + * + * @return promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * respond to the text asking for a donation. + */ + @JsonProperty(JSON_PROPERTY_PROMPT_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPromptTimeoutMs() { + return promptTimeoutMs; + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to respond to the text + * asking for a donation. + * + * @param promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * respond to the text asking for a donation. + */ + @JsonProperty(JSON_PROPERTY_PROMPT_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPromptTimeoutMs(Long promptTimeoutMs) { + this.promptTimeoutMs = promptTimeoutMs; + isSetPromptTimeoutMs = true; // mark as set + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + * @return the current {@code InPersonDonationSettingsResponse} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsResponse storeIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + return this; + } + + public InPersonDonationSettingsResponse addStoreIdsItem(String storeIdsItem) { + if (this.storeIds == null) { + this.storeIds = new ArrayList<>(); + } + this.storeIds.add(storeIdsItem); + return this; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @return storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStoreIds() { + return storeIds; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoreIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InPersonDonationSettingsResponse 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 InPersonDonationSettingsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InPersonDonationSettingsResponse inPersonDonationSettingsResponse = + (InPersonDonationSettingsResponse) o; + return Objects.equals(this.amounts, inPersonDonationSettingsResponse.amounts) + && Objects.equals(this.isSetAmounts, inPersonDonationSettingsResponse.isSetAmounts) + && Objects.equals(this.defaultCurrency, inPersonDonationSettingsResponse.defaultCurrency) + && Objects.equals( + this.isSetDefaultCurrency, inPersonDonationSettingsResponse.isSetDefaultCurrency) + && Objects.equals(this.displayTextField, inPersonDonationSettingsResponse.displayTextField) + && Objects.equals( + this.isSetDisplayTextField, inPersonDonationSettingsResponse.isSetDisplayTextField) + && Objects.equals(this.donationFlow, inPersonDonationSettingsResponse.donationFlow) + && Objects.equals( + this.isSetDonationFlow, inPersonDonationSettingsResponse.isSetDonationFlow) + && Objects.equals(this.donationType, inPersonDonationSettingsResponse.donationType) + && Objects.equals( + this.isSetDonationType, inPersonDonationSettingsResponse.isSetDonationType) + && Objects.equals(this.merchantAccounts, inPersonDonationSettingsResponse.merchantAccounts) + && Objects.equals( + this.isSetMerchantAccounts, inPersonDonationSettingsResponse.isSetMerchantAccounts) + && Objects.equals( + this.presentCardTimeoutMs, inPersonDonationSettingsResponse.presentCardTimeoutMs) + && Objects.equals( + this.isSetPresentCardTimeoutMs, + inPersonDonationSettingsResponse.isSetPresentCardTimeoutMs) + && Objects.equals(this.promptTimeoutMs, inPersonDonationSettingsResponse.promptTimeoutMs) + && Objects.equals( + this.isSetPromptTimeoutMs, inPersonDonationSettingsResponse.isSetPromptTimeoutMs) + && Objects.equals(this.storeIds, inPersonDonationSettingsResponse.storeIds) + && Objects.equals(this.isSetStoreIds, inPersonDonationSettingsResponse.isSetStoreIds); + } + + @Override + public int hashCode() { + return Objects.hash( + amounts, + isSetAmounts, + defaultCurrency, + isSetDefaultCurrency, + displayTextField, + isSetDisplayTextField, + donationFlow, + isSetDonationFlow, + donationType, + isSetDonationType, + merchantAccounts, + isSetMerchantAccounts, + presentCardTimeoutMs, + isSetPresentCardTimeoutMs, + promptTimeoutMs, + isSetPromptTimeoutMs, + storeIds, + isSetStoreIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InPersonDonationSettingsResponse {\n"); + sb.append(" amounts: ").append(toIndentedString(amounts)).append("\n"); + sb.append(" defaultCurrency: ").append(toIndentedString(defaultCurrency)).append("\n"); + sb.append(" displayTextField: ").append(toIndentedString(displayTextField)).append("\n"); + sb.append(" donationFlow: ").append(toIndentedString(donationFlow)).append("\n"); + sb.append(" donationType: ").append(toIndentedString(donationType)).append("\n"); + sb.append(" merchantAccounts: ").append(toIndentedString(merchantAccounts)).append("\n"); + sb.append(" presentCardTimeoutMs: ") + .append(toIndentedString(presentCardTimeoutMs)) + .append("\n"); + sb.append(" promptTimeoutMs: ").append(toIndentedString(promptTimeoutMs)).append("\n"); + sb.append(" storeIds: ").append(toIndentedString(storeIds)).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 (isSetAmounts) { + addIfNull(nulls, JSON_PROPERTY_AMOUNTS, this.amounts); + } + if (isSetDefaultCurrency) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY, this.defaultCurrency); + } + if (isSetDisplayTextField) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_TEXT_FIELD, this.displayTextField); + } + if (isSetDonationFlow) { + addIfNull(nulls, JSON_PROPERTY_DONATION_FLOW, this.donationFlow); + } + if (isSetDonationType) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TYPE, this.donationType); + } + if (isSetMerchantAccounts) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNTS, this.merchantAccounts); + } + if (isSetPresentCardTimeoutMs) { + addIfNull(nulls, JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS, this.presentCardTimeoutMs); + } + if (isSetPromptTimeoutMs) { + addIfNull(nulls, JSON_PROPERTY_PROMPT_TIMEOUT_MS, this.promptTimeoutMs); + } + if (isSetStoreIds) { + addIfNull(nulls, JSON_PROPERTY_STORE_IDS, this.storeIds); + } + + 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 InPersonDonationSettingsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of InPersonDonationSettingsResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * InPersonDonationSettingsResponse + */ + public static InPersonDonationSettingsResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InPersonDonationSettingsResponse.class); + } + + /** + * Convert an instance of InPersonDonationSettingsResponse 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/management/InPersonDonationSettingsUpdate.java b/src/main/java/com/adyen/model/management/InPersonDonationSettingsUpdate.java new file mode 100644 index 000000000..5ced7e8b0 --- /dev/null +++ b/src/main/java/com/adyen/model/management/InPersonDonationSettingsUpdate.java @@ -0,0 +1,597 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** InPersonDonationSettingsUpdate */ +@JsonPropertyOrder({ + InPersonDonationSettingsUpdate.JSON_PROPERTY_DEFAULT_AMOUNT, + InPersonDonationSettingsUpdate.JSON_PROPERTY_DISPLAY_TEXT_FIELD, + InPersonDonationSettingsUpdate.JSON_PROPERTY_DONATION_FLOW, + InPersonDonationSettingsUpdate.JSON_PROPERTY_DONATION_TYPE, + InPersonDonationSettingsUpdate.JSON_PROPERTY_MERCHANT_ACCOUNTS, + InPersonDonationSettingsUpdate.JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS, + InPersonDonationSettingsUpdate.JSON_PROPERTY_PROMPT_TIMEOUT_MS, + InPersonDonationSettingsUpdate.JSON_PROPERTY_STORE_IDS +}) +public class InPersonDonationSettingsUpdate { + public static final String JSON_PROPERTY_DEFAULT_AMOUNT = "defaultAmount"; + private DonationAmountUpdate defaultAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultAmount = false; + + public static final String JSON_PROPERTY_DISPLAY_TEXT_FIELD = "displayTextField"; + private DisplayTextField displayTextField; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayTextField = false; + + public static final String JSON_PROPERTY_DONATION_FLOW = "donationFlow"; + private DonationFlow donationFlow; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationFlow = false; + + public static final String JSON_PROPERTY_DONATION_TYPE = "donationType"; + private DonationType donationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationType = false; + + public static final String JSON_PROPERTY_MERCHANT_ACCOUNTS = "merchantAccounts"; + private List merchantAccounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccounts = false; + + public static final String JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS = "presentCardTimeoutMs"; + private Object presentCardTimeoutMs; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPresentCardTimeoutMs = false; + + public static final String JSON_PROPERTY_PROMPT_TIMEOUT_MS = "promptTimeoutMs"; + private Object promptTimeoutMs; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPromptTimeoutMs = false; + + public static final String JSON_PROPERTY_STORE_IDS = "storeIds"; + private List storeIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InPersonDonationSettingsUpdate() {} + + /** + * defaultAmount + * + * @param defaultAmount + * @return the current {@code InPersonDonationSettingsUpdate} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsUpdate defaultAmount(DonationAmountUpdate defaultAmount) { + this.defaultAmount = defaultAmount; + isSetDefaultAmount = true; // mark as set + return this; + } + + /** + * Get defaultAmount + * + * @return defaultAmount + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationAmountUpdate getDefaultAmount() { + return defaultAmount; + } + + /** + * defaultAmount + * + * @param defaultAmount + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultAmount(DonationAmountUpdate defaultAmount) { + this.defaultAmount = defaultAmount; + isSetDefaultAmount = true; // mark as set + } + + /** + * displayTextField + * + * @param displayTextField + * @return the current {@code InPersonDonationSettingsUpdate} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsUpdate displayTextField(DisplayTextField displayTextField) { + this.displayTextField = displayTextField; + isSetDisplayTextField = true; // mark as set + return this; + } + + /** + * Get displayTextField + * + * @return displayTextField + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_TEXT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DisplayTextField getDisplayTextField() { + return displayTextField; + } + + /** + * displayTextField + * + * @param displayTextField + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_TEXT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayTextField(DisplayTextField displayTextField) { + this.displayTextField = displayTextField; + isSetDisplayTextField = true; // mark as set + } + + /** + * donationFlow + * + * @param donationFlow + * @return the current {@code InPersonDonationSettingsUpdate} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsUpdate donationFlow(DonationFlow donationFlow) { + this.donationFlow = donationFlow; + isSetDonationFlow = true; // mark as set + return this; + } + + /** + * Get donationFlow + * + * @return donationFlow + */ + @JsonProperty(JSON_PROPERTY_DONATION_FLOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationFlow getDonationFlow() { + return donationFlow; + } + + /** + * donationFlow + * + * @param donationFlow + */ + @JsonProperty(JSON_PROPERTY_DONATION_FLOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationFlow(DonationFlow donationFlow) { + this.donationFlow = donationFlow; + isSetDonationFlow = true; // mark as set + } + + /** + * donationType + * + * @param donationType + * @return the current {@code InPersonDonationSettingsUpdate} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsUpdate donationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + return this; + } + + /** + * Get donationType + * + * @return donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationType getDonationType() { + return donationType; + } + + /** + * donationType + * + * @param donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + * @return the current {@code InPersonDonationSettingsUpdate} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsUpdate merchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + return this; + } + + public InPersonDonationSettingsUpdate addMerchantAccountsItem(String merchantAccountsItem) { + if (this.merchantAccounts == null) { + this.merchantAccounts = new ArrayList<>(); + } + this.merchantAccounts.add(merchantAccountsItem); + return this; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @return merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMerchantAccounts() { + return merchantAccounts; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + } + + /** + * Required if `donationFlow` is set to **twoStep**. The time, in milliseconds, that the + * terminal waits for the shopper to present their card. Defaults to **10000** (10 seconds). + * Range: 5000 to 15000. + * + * @param presentCardTimeoutMs Required if `donationFlow` is set to **twoStep**. The + * time, in milliseconds, that the terminal waits for the shopper to present their card. + * Defaults to **10000** (10 seconds). Range: 5000 to 15000. + * @return the current {@code InPersonDonationSettingsUpdate} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsUpdate presentCardTimeoutMs(Object presentCardTimeoutMs) { + this.presentCardTimeoutMs = presentCardTimeoutMs; + isSetPresentCardTimeoutMs = true; // mark as set + return this; + } + + /** + * Required if `donationFlow` is set to **twoStep**. The time, in milliseconds, that the + * terminal waits for the shopper to present their card. Defaults to **10000** (10 seconds). + * Range: 5000 to 15000. + * + * @return presentCardTimeoutMs Required if `donationFlow` is set to **twoStep**. The + * time, in milliseconds, that the terminal waits for the shopper to present their card. + * Defaults to **10000** (10 seconds). Range: 5000 to 15000. + */ + @JsonProperty(JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getPresentCardTimeoutMs() { + return presentCardTimeoutMs; + } + + /** + * Required if `donationFlow` is set to **twoStep**. The time, in milliseconds, that the + * terminal waits for the shopper to present their card. Defaults to **10000** (10 seconds). + * Range: 5000 to 15000. + * + * @param presentCardTimeoutMs Required if `donationFlow` is set to **twoStep**. The + * time, in milliseconds, that the terminal waits for the shopper to present their card. + * Defaults to **10000** (10 seconds). Range: 5000 to 15000. + */ + @JsonProperty(JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPresentCardTimeoutMs(Object presentCardTimeoutMs) { + this.presentCardTimeoutMs = presentCardTimeoutMs; + isSetPresentCardTimeoutMs = true; // mark as set + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to make a selection on the + * donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000. + * + * @param promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to + * 15000. + * @return the current {@code InPersonDonationSettingsUpdate} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsUpdate promptTimeoutMs(Object promptTimeoutMs) { + this.promptTimeoutMs = promptTimeoutMs; + isSetPromptTimeoutMs = true; // mark as set + return this; + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to make a selection on the + * donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000. + * + * @return promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to + * 15000. + */ + @JsonProperty(JSON_PROPERTY_PROMPT_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getPromptTimeoutMs() { + return promptTimeoutMs; + } + + /** + * The time, in milliseconds, that the terminal waits for the shopper to make a selection on the + * donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000. + * + * @param promptTimeoutMs The time, in milliseconds, that the terminal waits for the shopper to + * make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to + * 15000. + */ + @JsonProperty(JSON_PROPERTY_PROMPT_TIMEOUT_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPromptTimeoutMs(Object promptTimeoutMs) { + this.promptTimeoutMs = promptTimeoutMs; + isSetPromptTimeoutMs = true; // mark as set + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + * @return the current {@code InPersonDonationSettingsUpdate} instance, allowing for method + * chaining + */ + public InPersonDonationSettingsUpdate storeIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + return this; + } + + public InPersonDonationSettingsUpdate addStoreIdsItem(String storeIdsItem) { + if (this.storeIds == null) { + this.storeIds = new ArrayList<>(); + } + this.storeIds.add(storeIdsItem); + return this; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @return storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStoreIds() { + return storeIds; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoreIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InPersonDonationSettingsUpdate 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 InPersonDonationSettingsUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InPersonDonationSettingsUpdate inPersonDonationSettingsUpdate = + (InPersonDonationSettingsUpdate) o; + return Objects.equals(this.defaultAmount, inPersonDonationSettingsUpdate.defaultAmount) + && Objects.equals( + this.isSetDefaultAmount, inPersonDonationSettingsUpdate.isSetDefaultAmount) + && Objects.equals(this.displayTextField, inPersonDonationSettingsUpdate.displayTextField) + && Objects.equals( + this.isSetDisplayTextField, inPersonDonationSettingsUpdate.isSetDisplayTextField) + && Objects.equals(this.donationFlow, inPersonDonationSettingsUpdate.donationFlow) + && Objects.equals(this.isSetDonationFlow, inPersonDonationSettingsUpdate.isSetDonationFlow) + && Objects.equals(this.donationType, inPersonDonationSettingsUpdate.donationType) + && Objects.equals(this.isSetDonationType, inPersonDonationSettingsUpdate.isSetDonationType) + && Objects.equals(this.merchantAccounts, inPersonDonationSettingsUpdate.merchantAccounts) + && Objects.equals( + this.isSetMerchantAccounts, inPersonDonationSettingsUpdate.isSetMerchantAccounts) + && Objects.equals( + this.presentCardTimeoutMs, inPersonDonationSettingsUpdate.presentCardTimeoutMs) + && Objects.equals( + this.isSetPresentCardTimeoutMs, + inPersonDonationSettingsUpdate.isSetPresentCardTimeoutMs) + && Objects.equals(this.promptTimeoutMs, inPersonDonationSettingsUpdate.promptTimeoutMs) + && Objects.equals( + this.isSetPromptTimeoutMs, inPersonDonationSettingsUpdate.isSetPromptTimeoutMs) + && Objects.equals(this.storeIds, inPersonDonationSettingsUpdate.storeIds) + && Objects.equals(this.isSetStoreIds, inPersonDonationSettingsUpdate.isSetStoreIds); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultAmount, + isSetDefaultAmount, + displayTextField, + isSetDisplayTextField, + donationFlow, + isSetDonationFlow, + donationType, + isSetDonationType, + merchantAccounts, + isSetMerchantAccounts, + presentCardTimeoutMs, + isSetPresentCardTimeoutMs, + promptTimeoutMs, + isSetPromptTimeoutMs, + storeIds, + isSetStoreIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InPersonDonationSettingsUpdate {\n"); + sb.append(" defaultAmount: ").append(toIndentedString(defaultAmount)).append("\n"); + sb.append(" displayTextField: ").append(toIndentedString(displayTextField)).append("\n"); + sb.append(" donationFlow: ").append(toIndentedString(donationFlow)).append("\n"); + sb.append(" donationType: ").append(toIndentedString(donationType)).append("\n"); + sb.append(" merchantAccounts: ").append(toIndentedString(merchantAccounts)).append("\n"); + sb.append(" presentCardTimeoutMs: ") + .append(toIndentedString(presentCardTimeoutMs)) + .append("\n"); + sb.append(" promptTimeoutMs: ").append(toIndentedString(promptTimeoutMs)).append("\n"); + sb.append(" storeIds: ").append(toIndentedString(storeIds)).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 (isSetDefaultAmount) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_AMOUNT, this.defaultAmount); + } + if (isSetDisplayTextField) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_TEXT_FIELD, this.displayTextField); + } + if (isSetDonationFlow) { + addIfNull(nulls, JSON_PROPERTY_DONATION_FLOW, this.donationFlow); + } + if (isSetDonationType) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TYPE, this.donationType); + } + if (isSetMerchantAccounts) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNTS, this.merchantAccounts); + } + if (isSetPresentCardTimeoutMs) { + addIfNull(nulls, JSON_PROPERTY_PRESENT_CARD_TIMEOUT_MS, this.presentCardTimeoutMs); + } + if (isSetPromptTimeoutMs) { + addIfNull(nulls, JSON_PROPERTY_PROMPT_TIMEOUT_MS, this.promptTimeoutMs); + } + if (isSetStoreIds) { + addIfNull(nulls, JSON_PROPERTY_STORE_IDS, this.storeIds); + } + + 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 InPersonDonationSettingsUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of InPersonDonationSettingsUpdate + * @throws JsonProcessingException if the JSON string is invalid with respect to + * InPersonDonationSettingsUpdate + */ + public static InPersonDonationSettingsUpdate fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InPersonDonationSettingsUpdate.class); + } + + /** + * Convert an instance of InPersonDonationSettingsUpdate 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/management/ListDonationCampaignsResponse.java b/src/main/java/com/adyen/model/management/ListDonationCampaignsResponse.java new file mode 100644 index 000000000..07ed6fed5 --- /dev/null +++ b/src/main/java/com/adyen/model/management/ListDonationCampaignsResponse.java @@ -0,0 +1,345 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** ListDonationCampaignsResponse */ +@JsonPropertyOrder({ + ListDonationCampaignsResponse.JSON_PROPERTY_LINKS, + ListDonationCampaignsResponse.JSON_PROPERTY_CAMPAIGNS, + ListDonationCampaignsResponse.JSON_PROPERTY_ITEMS_TOTAL, + ListDonationCampaignsResponse.JSON_PROPERTY_PAGES_TOTAL +}) +public class ListDonationCampaignsResponse { + public static final String JSON_PROPERTY_LINKS = "_links"; + private PaginationLinks links; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLinks = false; + + public static final String JSON_PROPERTY_CAMPAIGNS = "campaigns"; + private List campaigns; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCampaigns = false; + + public static final String JSON_PROPERTY_ITEMS_TOTAL = "itemsTotal"; + private Integer itemsTotal; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemsTotal = false; + + public static final String JSON_PROPERTY_PAGES_TOTAL = "pagesTotal"; + private Integer pagesTotal; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPagesTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ListDonationCampaignsResponse() {} + + /** + * links + * + * @param links + * @return the current {@code ListDonationCampaignsResponse} instance, allowing for method + * chaining + */ + public ListDonationCampaignsResponse links(PaginationLinks links) { + this.links = links; + isSetLinks = true; // mark as set + return this; + } + + /** + * Get links + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaginationLinks getLinks() { + return links; + } + + /** + * links + * + * @param links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinks(PaginationLinks links) { + this.links = links; + isSetLinks = true; // mark as set + } + + /** + * The list of donation campaigns. + * + * @param campaigns The list of donation campaigns. + * @return the current {@code ListDonationCampaignsResponse} instance, allowing for method + * chaining + */ + public ListDonationCampaignsResponse campaigns(List campaigns) { + this.campaigns = campaigns; + isSetCampaigns = true; // mark as set + return this; + } + + public ListDonationCampaignsResponse addCampaignsItem(DonationCampaign campaignsItem) { + if (this.campaigns == null) { + this.campaigns = new ArrayList<>(); + } + this.campaigns.add(campaignsItem); + return this; + } + + /** + * The list of donation campaigns. + * + * @return campaigns The list of donation campaigns. + */ + @JsonProperty(JSON_PROPERTY_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCampaigns() { + return campaigns; + } + + /** + * The list of donation campaigns. + * + * @param campaigns The list of donation campaigns. + */ + @JsonProperty(JSON_PROPERTY_CAMPAIGNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCampaigns(List campaigns) { + this.campaigns = campaigns; + isSetCampaigns = true; // mark as set + } + + /** + * Total number of items. + * + * @param itemsTotal Total number of items. + * @return the current {@code ListDonationCampaignsResponse} instance, allowing for method + * chaining + */ + public ListDonationCampaignsResponse itemsTotal(Integer itemsTotal) { + this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set + return this; + } + + /** + * Total number of items. + * + * @return itemsTotal Total number of items. + */ + @JsonProperty(JSON_PROPERTY_ITEMS_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getItemsTotal() { + return itemsTotal; + } + + /** + * Total number of items. + * + * @param itemsTotal Total number of items. + */ + @JsonProperty(JSON_PROPERTY_ITEMS_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsTotal(Integer itemsTotal) { + this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set + } + + /** + * Total number of pages. + * + * @param pagesTotal Total number of pages. + * @return the current {@code ListDonationCampaignsResponse} instance, allowing for method + * chaining + */ + public ListDonationCampaignsResponse pagesTotal(Integer pagesTotal) { + this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set + return this; + } + + /** + * Total number of pages. + * + * @return pagesTotal Total number of pages. + */ + @JsonProperty(JSON_PROPERTY_PAGES_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPagesTotal() { + return pagesTotal; + } + + /** + * Total number of pages. + * + * @param pagesTotal Total number of pages. + */ + @JsonProperty(JSON_PROPERTY_PAGES_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPagesTotal(Integer pagesTotal) { + this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListDonationCampaignsResponse 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 ListDonationCampaignsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListDonationCampaignsResponse listDonationCampaignsResponse = (ListDonationCampaignsResponse) o; + return Objects.equals(this.links, listDonationCampaignsResponse.links) + && Objects.equals(this.isSetLinks, listDonationCampaignsResponse.isSetLinks) + && Objects.equals(this.campaigns, listDonationCampaignsResponse.campaigns) + && Objects.equals(this.isSetCampaigns, listDonationCampaignsResponse.isSetCampaigns) + && Objects.equals(this.itemsTotal, listDonationCampaignsResponse.itemsTotal) + && Objects.equals(this.isSetItemsTotal, listDonationCampaignsResponse.isSetItemsTotal) + && Objects.equals(this.pagesTotal, listDonationCampaignsResponse.pagesTotal) + && Objects.equals(this.isSetPagesTotal, listDonationCampaignsResponse.isSetPagesTotal); + } + + @Override + public int hashCode() { + return Objects.hash( + links, + isSetLinks, + campaigns, + isSetCampaigns, + itemsTotal, + isSetItemsTotal, + pagesTotal, + isSetPagesTotal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListDonationCampaignsResponse {\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" campaigns: ").append(toIndentedString(campaigns)).append("\n"); + sb.append(" itemsTotal: ").append(toIndentedString(itemsTotal)).append("\n"); + sb.append(" pagesTotal: ").append(toIndentedString(pagesTotal)).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 (isSetLinks) { + addIfNull(nulls, JSON_PROPERTY_LINKS, this.links); + } + if (isSetCampaigns) { + addIfNull(nulls, JSON_PROPERTY_CAMPAIGNS, this.campaigns); + } + if (isSetItemsTotal) { + addIfNull(nulls, JSON_PROPERTY_ITEMS_TOTAL, this.itemsTotal); + } + if (isSetPagesTotal) { + addIfNull(nulls, JSON_PROPERTY_PAGES_TOTAL, this.pagesTotal); + } + + 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 ListDonationCampaignsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListDonationCampaignsResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ListDonationCampaignsResponse + */ + public static ListDonationCampaignsResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ListDonationCampaignsResponse.class); + } + + /** + * Convert an instance of ListDonationCampaignsResponse 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/management/ListNonprofitsRequest.java b/src/main/java/com/adyen/model/management/ListNonprofitsRequest.java new file mode 100644 index 000000000..f0c7deb16 --- /dev/null +++ b/src/main/java/com/adyen/model/management/ListNonprofitsRequest.java @@ -0,0 +1,189 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** ListNonprofitsRequest */ +@JsonPropertyOrder({ListNonprofitsRequest.JSON_PROPERTY_ACCOUNT_HOLDER_IDS}) +public class ListNonprofitsRequest { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_IDS = "accountHolderIds"; + private List accountHolderIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ListNonprofitsRequest() {} + + /** + * The unique identifiers of the account holders to be included in a donation campaign. + * + * @param accountHolderIds The unique identifiers of the account holders to be included in a + * donation campaign. + * @return the current {@code ListNonprofitsRequest} instance, allowing for method chaining + */ + public ListNonprofitsRequest accountHolderIds(List accountHolderIds) { + this.accountHolderIds = accountHolderIds; + isSetAccountHolderIds = true; // mark as set + return this; + } + + public ListNonprofitsRequest addAccountHolderIdsItem(String accountHolderIdsItem) { + if (this.accountHolderIds == null) { + this.accountHolderIds = new ArrayList<>(); + } + this.accountHolderIds.add(accountHolderIdsItem); + return this; + } + + /** + * The unique identifiers of the account holders to be included in a donation campaign. + * + * @return accountHolderIds The unique identifiers of the account holders to be included in a + * donation campaign. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccountHolderIds() { + return accountHolderIds; + } + + /** + * The unique identifiers of the account holders to be included in a donation campaign. + * + * @param accountHolderIds The unique identifiers of the account holders to be included in a + * donation campaign. + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolderIds(List accountHolderIds) { + this.accountHolderIds = accountHolderIds; + isSetAccountHolderIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListNonprofitsRequest 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 ListNonprofitsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListNonprofitsRequest listNonprofitsRequest = (ListNonprofitsRequest) o; + return Objects.equals(this.accountHolderIds, listNonprofitsRequest.accountHolderIds) + && Objects.equals(this.isSetAccountHolderIds, listNonprofitsRequest.isSetAccountHolderIds); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolderIds, isSetAccountHolderIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListNonprofitsRequest {\n"); + sb.append(" accountHolderIds: ").append(toIndentedString(accountHolderIds)).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 (isSetAccountHolderIds) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_IDS, this.accountHolderIds); + } + + 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 ListNonprofitsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListNonprofitsRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ListNonprofitsRequest + */ + public static ListNonprofitsRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ListNonprofitsRequest.class); + } + + /** + * Convert an instance of ListNonprofitsRequest 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/management/ListNonprofitsResponse.java b/src/main/java/com/adyen/model/management/ListNonprofitsResponse.java new file mode 100644 index 000000000..fedbe7fff --- /dev/null +++ b/src/main/java/com/adyen/model/management/ListNonprofitsResponse.java @@ -0,0 +1,340 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** ListNonprofitsResponse */ +@JsonPropertyOrder({ + ListNonprofitsResponse.JSON_PROPERTY_LINKS, + ListNonprofitsResponse.JSON_PROPERTY_ITEMS_TOTAL, + ListNonprofitsResponse.JSON_PROPERTY_NONPROFITS, + ListNonprofitsResponse.JSON_PROPERTY_PAGES_TOTAL +}) +public class ListNonprofitsResponse { + public static final String JSON_PROPERTY_LINKS = "_links"; + private PaginationLinks links; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLinks = false; + + public static final String JSON_PROPERTY_ITEMS_TOTAL = "itemsTotal"; + private Integer itemsTotal; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemsTotal = false; + + public static final String JSON_PROPERTY_NONPROFITS = "nonprofits"; + private List nonprofits; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofits = false; + + public static final String JSON_PROPERTY_PAGES_TOTAL = "pagesTotal"; + private Integer pagesTotal; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPagesTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ListNonprofitsResponse() {} + + /** + * links + * + * @param links + * @return the current {@code ListNonprofitsResponse} instance, allowing for method chaining + */ + public ListNonprofitsResponse links(PaginationLinks links) { + this.links = links; + isSetLinks = true; // mark as set + return this; + } + + /** + * Get links + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PaginationLinks getLinks() { + return links; + } + + /** + * links + * + * @param links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinks(PaginationLinks links) { + this.links = links; + isSetLinks = true; // mark as set + } + + /** + * Total number of items. + * + * @param itemsTotal Total number of items. + * @return the current {@code ListNonprofitsResponse} instance, allowing for method chaining + */ + public ListNonprofitsResponse itemsTotal(Integer itemsTotal) { + this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set + return this; + } + + /** + * Total number of items. + * + * @return itemsTotal Total number of items. + */ + @JsonProperty(JSON_PROPERTY_ITEMS_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getItemsTotal() { + return itemsTotal; + } + + /** + * Total number of items. + * + * @param itemsTotal Total number of items. + */ + @JsonProperty(JSON_PROPERTY_ITEMS_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemsTotal(Integer itemsTotal) { + this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set + } + + /** + * The supported nonprofit organizations. + * + * @param nonprofits The supported nonprofit organizations. + * @return the current {@code ListNonprofitsResponse} instance, allowing for method chaining + */ + public ListNonprofitsResponse nonprofits(List nonprofits) { + this.nonprofits = nonprofits; + isSetNonprofits = true; // mark as set + return this; + } + + public ListNonprofitsResponse addNonprofitsItem(Nonprofit nonprofitsItem) { + if (this.nonprofits == null) { + this.nonprofits = new ArrayList<>(); + } + this.nonprofits.add(nonprofitsItem); + return this; + } + + /** + * The supported nonprofit organizations. + * + * @return nonprofits The supported nonprofit organizations. + */ + @JsonProperty(JSON_PROPERTY_NONPROFITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNonprofits() { + return nonprofits; + } + + /** + * The supported nonprofit organizations. + * + * @param nonprofits The supported nonprofit organizations. + */ + @JsonProperty(JSON_PROPERTY_NONPROFITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNonprofits(List nonprofits) { + this.nonprofits = nonprofits; + isSetNonprofits = true; // mark as set + } + + /** + * Total number of pages. + * + * @param pagesTotal Total number of pages. + * @return the current {@code ListNonprofitsResponse} instance, allowing for method chaining + */ + public ListNonprofitsResponse pagesTotal(Integer pagesTotal) { + this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set + return this; + } + + /** + * Total number of pages. + * + * @return pagesTotal Total number of pages. + */ + @JsonProperty(JSON_PROPERTY_PAGES_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPagesTotal() { + return pagesTotal; + } + + /** + * Total number of pages. + * + * @param pagesTotal Total number of pages. + */ + @JsonProperty(JSON_PROPERTY_PAGES_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPagesTotal(Integer pagesTotal) { + this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListNonprofitsResponse 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 ListNonprofitsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListNonprofitsResponse listNonprofitsResponse = (ListNonprofitsResponse) o; + return Objects.equals(this.links, listNonprofitsResponse.links) + && Objects.equals(this.isSetLinks, listNonprofitsResponse.isSetLinks) + && Objects.equals(this.itemsTotal, listNonprofitsResponse.itemsTotal) + && Objects.equals(this.isSetItemsTotal, listNonprofitsResponse.isSetItemsTotal) + && Objects.equals(this.nonprofits, listNonprofitsResponse.nonprofits) + && Objects.equals(this.isSetNonprofits, listNonprofitsResponse.isSetNonprofits) + && Objects.equals(this.pagesTotal, listNonprofitsResponse.pagesTotal) + && Objects.equals(this.isSetPagesTotal, listNonprofitsResponse.isSetPagesTotal); + } + + @Override + public int hashCode() { + return Objects.hash( + links, + isSetLinks, + itemsTotal, + isSetItemsTotal, + nonprofits, + isSetNonprofits, + pagesTotal, + isSetPagesTotal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListNonprofitsResponse {\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" itemsTotal: ").append(toIndentedString(itemsTotal)).append("\n"); + sb.append(" nonprofits: ").append(toIndentedString(nonprofits)).append("\n"); + sb.append(" pagesTotal: ").append(toIndentedString(pagesTotal)).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 (isSetLinks) { + addIfNull(nulls, JSON_PROPERTY_LINKS, this.links); + } + if (isSetItemsTotal) { + addIfNull(nulls, JSON_PROPERTY_ITEMS_TOTAL, this.itemsTotal); + } + if (isSetNonprofits) { + addIfNull(nulls, JSON_PROPERTY_NONPROFITS, this.nonprofits); + } + if (isSetPagesTotal) { + addIfNull(nulls, JSON_PROPERTY_PAGES_TOTAL, this.pagesTotal); + } + + 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 ListNonprofitsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListNonprofitsResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ListNonprofitsResponse + */ + public static ListNonprofitsResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ListNonprofitsResponse.class); + } + + /** + * Convert an instance of ListNonprofitsResponse 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/management/MealVoucherFRInfo.java b/src/main/java/com/adyen/model/management/MealVoucherFRInfo.java index c6835e97c..12b159336 100644 --- a/src/main/java/com/adyen/model/management/MealVoucherFRInfo.java +++ b/src/main/java/com/adyen/model/management/MealVoucherFRInfo.java @@ -125,11 +125,11 @@ public void setSiret(String siret) { } /** - * The list of additional payment methods. Allowed values: **mealVoucher_FR_edenred**, + * The list of additional payment methods. Allowed values: **mealVoucher_FR_endenred**, * **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**. * * @param subTypes The list of additional payment methods. Allowed values: - * **mealVoucher_FR_edenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, + * **mealVoucher_FR_endenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, * **mealVoucher_FR_sodexo**. * @return the current {@code MealVoucherFRInfo} instance, allowing for method chaining */ @@ -148,11 +148,11 @@ public MealVoucherFRInfo addSubTypesItem(String subTypesItem) { } /** - * The list of additional payment methods. Allowed values: **mealVoucher_FR_edenred**, + * The list of additional payment methods. Allowed values: **mealVoucher_FR_endenred**, * **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**. * * @return subTypes The list of additional payment methods. Allowed values: - * **mealVoucher_FR_edenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, + * **mealVoucher_FR_endenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, * **mealVoucher_FR_sodexo**. */ @JsonProperty(JSON_PROPERTY_SUB_TYPES) @@ -162,11 +162,11 @@ public List getSubTypes() { } /** - * The list of additional payment methods. Allowed values: **mealVoucher_FR_edenred**, + * The list of additional payment methods. Allowed values: **mealVoucher_FR_endenred**, * **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**. * * @param subTypes The list of additional payment methods. Allowed values: - * **mealVoucher_FR_edenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, + * **mealVoucher_FR_endenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, * **mealVoucher_FR_sodexo**. */ @JsonProperty(JSON_PROPERTY_SUB_TYPES) diff --git a/src/main/java/com/adyen/model/management/Nonprofit.java b/src/main/java/com/adyen/model/management/Nonprofit.java new file mode 100644 index 000000000..c89ee32ab --- /dev/null +++ b/src/main/java/com/adyen/model/management/Nonprofit.java @@ -0,0 +1,680 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** Nonprofit */ +@JsonPropertyOrder({ + Nonprofit.JSON_PROPERTY_CAUSES, + Nonprofit.JSON_PROPERTY_DESCRIPTION, + Nonprofit.JSON_PROPERTY_GOALS, + Nonprofit.JSON_PROPERTY_ID, + Nonprofit.JSON_PROPERTY_LOCALES, + Nonprofit.JSON_PROPERTY_LOGO_URL, + Nonprofit.JSON_PROPERTY_NAME, + Nonprofit.JSON_PROPERTY_REGIONS, + Nonprofit.JSON_PROPERTY_TERMS_AND_CONDITIONS_URL, + Nonprofit.JSON_PROPERTY_WEBSITE +}) +public class Nonprofit { + public static final String JSON_PROPERTY_CAUSES = "causes"; + private List causes; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCauses = 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_GOALS = "goals"; + private List goals; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGoals = 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_LOCALES = "locales"; + private List locales; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocales = false; + + public static final String JSON_PROPERTY_LOGO_URL = "logoUrl"; + private String logoUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoUrl = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + public static final String JSON_PROPERTY_REGIONS = "regions"; + private List regions; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegions = false; + + public static final String JSON_PROPERTY_TERMS_AND_CONDITIONS_URL = "termsAndConditionsUrl"; + private String termsAndConditionsUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsAndConditionsUrl = false; + + public static final String JSON_PROPERTY_WEBSITE = "website"; + private String website; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebsite = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Nonprofit() {} + + /** + * The causes that the nonprofit supports. + * + * @param causes The causes that the nonprofit supports. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit causes(List causes) { + this.causes = causes; + isSetCauses = true; // mark as set + return this; + } + + public Nonprofit addCausesItem(NonprofitCause causesItem) { + if (this.causes == null) { + this.causes = new ArrayList<>(); + } + this.causes.add(causesItem); + return this; + } + + /** + * The causes that the nonprofit supports. + * + * @return causes The causes that the nonprofit supports. + */ + @JsonProperty(JSON_PROPERTY_CAUSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCauses() { + return causes; + } + + /** + * The causes that the nonprofit supports. + * + * @param causes The causes that the nonprofit supports. + */ + @JsonProperty(JSON_PROPERTY_CAUSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCauses(List causes) { + this.causes = causes; + isSetCauses = true; // mark as set + } + + /** + * The description of the nonprofit. + * + * @param description The description of the nonprofit. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * The description of the nonprofit. + * + * @return description The description of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * The description of the nonprofit. + * + * @param description The description of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * The goals of the nonprofit. + * + * @param goals The goals of the nonprofit. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit goals(List goals) { + this.goals = goals; + isSetGoals = true; // mark as set + return this; + } + + public Nonprofit addGoalsItem(String goalsItem) { + if (this.goals == null) { + this.goals = new ArrayList<>(); + } + this.goals.add(goalsItem); + return this; + } + + /** + * The goals of the nonprofit. + * + * @return goals The goals of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_GOALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGoals() { + return goals; + } + + /** + * The goals of the nonprofit. + * + * @param goals The goals of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_GOALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGoals(List goals) { + this.goals = goals; + isSetGoals = true; // mark as set + } + + /** + * The unique identifier of the nonprofit organization. This value is generated by Adyen. + * + * @param id The unique identifier of the nonprofit organization. This value is generated by + * Adyen. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the nonprofit organization. This value is generated by Adyen. + * + * @return id The unique identifier of the nonprofit organization. This value is generated by + * Adyen. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the nonprofit organization. This value is generated by Adyen. + * + * @param id The unique identifier of the nonprofit organization. This value is generated by + * Adyen. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * The locales that the nonprofit supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + * + * @param locales The locales that the nonprofit supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit locales(List locales) { + this.locales = locales; + isSetLocales = true; // mark as set + return this; + } + + public Nonprofit addLocalesItem(String localesItem) { + if (this.locales == null) { + this.locales = new ArrayList<>(); + } + this.locales.add(localesItem); + return this; + } + + /** + * The locales that the nonprofit supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + * + * @return locales The locales that the nonprofit supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + */ + @JsonProperty(JSON_PROPERTY_LOCALES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocales() { + return locales; + } + + /** + * The locales that the nonprofit supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + * + * @param locales The locales that the nonprofit supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + */ + @JsonProperty(JSON_PROPERTY_LOCALES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocales(List locales) { + this.locales = locales; + isSetLocales = true; // mark as set + } + + /** + * The URL to the logo of the nonprofit. + * + * @param logoUrl The URL to the logo of the nonprofit. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit logoUrl(String logoUrl) { + this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set + return this; + } + + /** + * The URL to the logo of the nonprofit. + * + * @return logoUrl The URL to the logo of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_LOGO_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLogoUrl() { + return logoUrl; + } + + /** + * The URL to the logo of the nonprofit. + * + * @param logoUrl The URL to the logo of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_LOGO_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogoUrl(String logoUrl) { + this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set + } + + /** + * The name of the nonprofit. + * + * @param name The name of the nonprofit. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The name of the nonprofit. + * + * @return name The name of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The name of the nonprofit. + * + * @param name The name of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set + } + + /** + * The regions where the nonprofit operates, in [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + * + * @param regions The regions where the nonprofit operates, in [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit regions(List regions) { + this.regions = regions; + isSetRegions = true; // mark as set + return this; + } + + public Nonprofit addRegionsItem(String regionsItem) { + if (this.regions == null) { + this.regions = new ArrayList<>(); + } + this.regions.add(regionsItem); + return this; + } + + /** + * The regions where the nonprofit operates, in [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + * + * @return regions The regions where the nonprofit operates, in [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + */ + @JsonProperty(JSON_PROPERTY_REGIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRegions() { + return regions; + } + + /** + * The regions where the nonprofit operates, in [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + * + * @param regions The regions where the nonprofit operates, in [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. + */ + @JsonProperty(JSON_PROPERTY_REGIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRegions(List regions) { + this.regions = regions; + isSetRegions = true; // mark as set + } + + /** + * The URL to the terms and conditions of the nonprofit. + * + * @param termsAndConditionsUrl The URL to the terms and conditions of the nonprofit. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit termsAndConditionsUrl(String termsAndConditionsUrl) { + this.termsAndConditionsUrl = termsAndConditionsUrl; + isSetTermsAndConditionsUrl = true; // mark as set + return this; + } + + /** + * The URL to the terms and conditions of the nonprofit. + * + * @return termsAndConditionsUrl The URL to the terms and conditions of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_TERMS_AND_CONDITIONS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTermsAndConditionsUrl() { + return termsAndConditionsUrl; + } + + /** + * The URL to the terms and conditions of the nonprofit. + * + * @param termsAndConditionsUrl The URL to the terms and conditions of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_TERMS_AND_CONDITIONS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTermsAndConditionsUrl(String termsAndConditionsUrl) { + this.termsAndConditionsUrl = termsAndConditionsUrl; + isSetTermsAndConditionsUrl = true; // mark as set + } + + /** + * The URL to the website of the nonprofit. + * + * @param website The URL to the website of the nonprofit. + * @return the current {@code Nonprofit} instance, allowing for method chaining + */ + public Nonprofit website(String website) { + this.website = website; + isSetWebsite = true; // mark as set + return this; + } + + /** + * The URL to the website of the nonprofit. + * + * @return website The URL to the website of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_WEBSITE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWebsite() { + return website; + } + + /** + * The URL to the website of the nonprofit. + * + * @param website The URL to the website of the nonprofit. + */ + @JsonProperty(JSON_PROPERTY_WEBSITE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebsite(String website) { + this.website = website; + isSetWebsite = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Nonprofit 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 Nonprofit object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Nonprofit nonprofit = (Nonprofit) o; + return Objects.equals(this.causes, nonprofit.causes) + && Objects.equals(this.isSetCauses, nonprofit.isSetCauses) + && Objects.equals(this.description, nonprofit.description) + && Objects.equals(this.isSetDescription, nonprofit.isSetDescription) + && Objects.equals(this.goals, nonprofit.goals) + && Objects.equals(this.isSetGoals, nonprofit.isSetGoals) + && Objects.equals(this.id, nonprofit.id) + && Objects.equals(this.isSetId, nonprofit.isSetId) + && Objects.equals(this.locales, nonprofit.locales) + && Objects.equals(this.isSetLocales, nonprofit.isSetLocales) + && Objects.equals(this.logoUrl, nonprofit.logoUrl) + && Objects.equals(this.isSetLogoUrl, nonprofit.isSetLogoUrl) + && Objects.equals(this.name, nonprofit.name) + && Objects.equals(this.isSetName, nonprofit.isSetName) + && Objects.equals(this.regions, nonprofit.regions) + && Objects.equals(this.isSetRegions, nonprofit.isSetRegions) + && Objects.equals(this.termsAndConditionsUrl, nonprofit.termsAndConditionsUrl) + && Objects.equals(this.isSetTermsAndConditionsUrl, nonprofit.isSetTermsAndConditionsUrl) + && Objects.equals(this.website, nonprofit.website) + && Objects.equals(this.isSetWebsite, nonprofit.isSetWebsite); + } + + @Override + public int hashCode() { + return Objects.hash( + causes, + isSetCauses, + description, + isSetDescription, + goals, + isSetGoals, + id, + isSetId, + locales, + isSetLocales, + logoUrl, + isSetLogoUrl, + name, + isSetName, + regions, + isSetRegions, + termsAndConditionsUrl, + isSetTermsAndConditionsUrl, + website, + isSetWebsite); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Nonprofit {\n"); + sb.append(" causes: ").append(toIndentedString(causes)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" goals: ").append(toIndentedString(goals)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" locales: ").append(toIndentedString(locales)).append("\n"); + sb.append(" logoUrl: ").append(toIndentedString(logoUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" regions: ").append(toIndentedString(regions)).append("\n"); + sb.append(" termsAndConditionsUrl: ") + .append(toIndentedString(termsAndConditionsUrl)) + .append("\n"); + sb.append(" website: ").append(toIndentedString(website)).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 (isSetCauses) { + addIfNull(nulls, JSON_PROPERTY_CAUSES, this.causes); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetGoals) { + addIfNull(nulls, JSON_PROPERTY_GOALS, this.goals); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLocales) { + addIfNull(nulls, JSON_PROPERTY_LOCALES, this.locales); + } + if (isSetLogoUrl) { + addIfNull(nulls, JSON_PROPERTY_LOGO_URL, this.logoUrl); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetRegions) { + addIfNull(nulls, JSON_PROPERTY_REGIONS, this.regions); + } + if (isSetTermsAndConditionsUrl) { + addIfNull(nulls, JSON_PROPERTY_TERMS_AND_CONDITIONS_URL, this.termsAndConditionsUrl); + } + if (isSetWebsite) { + addIfNull(nulls, JSON_PROPERTY_WEBSITE, this.website); + } + + 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 Nonprofit given an JSON string + * + * @param jsonString JSON string + * @return An instance of Nonprofit + * @throws JsonProcessingException if the JSON string is invalid with respect to Nonprofit + */ + public static Nonprofit fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Nonprofit.class); + } + + /** + * Convert an instance of Nonprofit 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/management/NonprofitCause.java b/src/main/java/com/adyen/model/management/NonprofitCause.java new file mode 100644 index 000000000..a7c9e7bbf --- /dev/null +++ b/src/main/java/com/adyen/model/management/NonprofitCause.java @@ -0,0 +1,395 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** NonprofitCause */ +@JsonPropertyOrder({ + NonprofitCause.JSON_PROPERTY_BANNER_URL, + NonprofitCause.JSON_PROPERTY_DESCRIPTION, + NonprofitCause.JSON_PROPERTY_ID, + NonprofitCause.JSON_PROPERTY_LOCALES, + NonprofitCause.JSON_PROPERTY_NAME +}) +public class NonprofitCause { + public static final String JSON_PROPERTY_BANNER_URL = "bannerUrl"; + private String bannerUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBannerUrl = 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_LOCALES = "locales"; + private List locales; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocales = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public NonprofitCause() {} + + /** + * The URL to the banner of the cause. + * + * @param bannerUrl The URL to the banner of the cause. + * @return the current {@code NonprofitCause} instance, allowing for method chaining + */ + public NonprofitCause bannerUrl(String bannerUrl) { + this.bannerUrl = bannerUrl; + isSetBannerUrl = true; // mark as set + return this; + } + + /** + * The URL to the banner of the cause. + * + * @return bannerUrl The URL to the banner of the cause. + */ + @JsonProperty(JSON_PROPERTY_BANNER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBannerUrl() { + return bannerUrl; + } + + /** + * The URL to the banner of the cause. + * + * @param bannerUrl The URL to the banner of the cause. + */ + @JsonProperty(JSON_PROPERTY_BANNER_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBannerUrl(String bannerUrl) { + this.bannerUrl = bannerUrl; + isSetBannerUrl = true; // mark as set + } + + /** + * The description of the cause. + * + * @param description The description of the cause. + * @return the current {@code NonprofitCause} instance, allowing for method chaining + */ + public NonprofitCause description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * The description of the cause. + * + * @return description The description of the cause. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * The description of the cause. + * + * @param description The description of the cause. + */ + @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 cause. This value is generated by Adyen. + * + * @param id The unique identifier of the cause. This value is generated by Adyen. + * @return the current {@code NonprofitCause} instance, allowing for method chaining + */ + public NonprofitCause id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the cause. This value is generated by Adyen. + * + * @return id The unique identifier of the cause. This value is generated by Adyen. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the cause. This value is generated by Adyen. + * + * @param id The unique identifier of the cause. This value is generated by Adyen. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * The locales that the cause supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + * + * @param locales The locales that the cause supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + * @return the current {@code NonprofitCause} instance, allowing for method chaining + */ + public NonprofitCause locales(List locales) { + this.locales = locales; + isSetLocales = true; // mark as set + return this; + } + + public NonprofitCause addLocalesItem(String localesItem) { + if (this.locales == null) { + this.locales = new ArrayList<>(); + } + this.locales.add(localesItem); + return this; + } + + /** + * The locales that the cause supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + * + * @return locales The locales that the cause supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + */ + @JsonProperty(JSON_PROPERTY_LOCALES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLocales() { + return locales; + } + + /** + * The locales that the cause supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + * + * @param locales The locales that the cause supports, in [IETF BCP + * 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. + */ + @JsonProperty(JSON_PROPERTY_LOCALES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocales(List locales) { + this.locales = locales; + isSetLocales = true; // mark as set + } + + /** + * The name of the cause. + * + * @param name The name of the cause. + * @return the current {@code NonprofitCause} instance, allowing for method chaining + */ + public NonprofitCause name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The name of the cause. + * + * @return name The name of the cause. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The name of the cause. + * + * @param name The name of the cause. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NonprofitCause 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 NonprofitCause object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NonprofitCause nonprofitCause = (NonprofitCause) o; + return Objects.equals(this.bannerUrl, nonprofitCause.bannerUrl) + && Objects.equals(this.isSetBannerUrl, nonprofitCause.isSetBannerUrl) + && Objects.equals(this.description, nonprofitCause.description) + && Objects.equals(this.isSetDescription, nonprofitCause.isSetDescription) + && Objects.equals(this.id, nonprofitCause.id) + && Objects.equals(this.isSetId, nonprofitCause.isSetId) + && Objects.equals(this.locales, nonprofitCause.locales) + && Objects.equals(this.isSetLocales, nonprofitCause.isSetLocales) + && Objects.equals(this.name, nonprofitCause.name) + && Objects.equals(this.isSetName, nonprofitCause.isSetName); + } + + @Override + public int hashCode() { + return Objects.hash( + bannerUrl, + isSetBannerUrl, + description, + isSetDescription, + id, + isSetId, + locales, + isSetLocales, + name, + isSetName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NonprofitCause {\n"); + sb.append(" bannerUrl: ").append(toIndentedString(bannerUrl)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" locales: ").append(toIndentedString(locales)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 (isSetBannerUrl) { + addIfNull(nulls, JSON_PROPERTY_BANNER_URL, this.bannerUrl); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLocales) { + addIfNull(nulls, JSON_PROPERTY_LOCALES, this.locales); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + 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 NonprofitCause given an JSON string + * + * @param jsonString JSON string + * @return An instance of NonprofitCause + * @throws JsonProcessingException if the JSON string is invalid with respect to NonprofitCause + */ + public static NonprofitCause fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, NonprofitCause.class); + } + + /** + * Convert an instance of NonprofitCause 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/management/OnlineDonationSettings.java b/src/main/java/com/adyen/model/management/OnlineDonationSettings.java new file mode 100644 index 000000000..48a0d8d26 --- /dev/null +++ b/src/main/java/com/adyen/model/management/OnlineDonationSettings.java @@ -0,0 +1,357 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** OnlineDonationSettings */ +@JsonPropertyOrder({ + OnlineDonationSettings.JSON_PROPERTY_DEFAULT_AMOUNT, + OnlineDonationSettings.JSON_PROPERTY_DONATION_TYPE, + OnlineDonationSettings.JSON_PROPERTY_MERCHANT_ACCOUNTS, + OnlineDonationSettings.JSON_PROPERTY_STORE_IDS +}) +public class OnlineDonationSettings { + public static final String JSON_PROPERTY_DEFAULT_AMOUNT = "defaultAmount"; + private DonationAmount defaultAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultAmount = false; + + public static final String JSON_PROPERTY_DONATION_TYPE = "donationType"; + private DonationType donationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationType = false; + + public static final String JSON_PROPERTY_MERCHANT_ACCOUNTS = "merchantAccounts"; + private List merchantAccounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccounts = false; + + public static final String JSON_PROPERTY_STORE_IDS = "storeIds"; + private List storeIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OnlineDonationSettings() {} + + /** + * defaultAmount + * + * @param defaultAmount + * @return the current {@code OnlineDonationSettings} instance, allowing for method chaining + */ + public OnlineDonationSettings defaultAmount(DonationAmount defaultAmount) { + this.defaultAmount = defaultAmount; + isSetDefaultAmount = true; // mark as set + return this; + } + + /** + * Get defaultAmount + * + * @return defaultAmount + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationAmount getDefaultAmount() { + return defaultAmount; + } + + /** + * defaultAmount + * + * @param defaultAmount + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultAmount(DonationAmount defaultAmount) { + this.defaultAmount = defaultAmount; + isSetDefaultAmount = true; // mark as set + } + + /** + * donationType + * + * @param donationType + * @return the current {@code OnlineDonationSettings} instance, allowing for method chaining + */ + public OnlineDonationSettings donationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + return this; + } + + /** + * Get donationType + * + * @return donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationType getDonationType() { + return donationType; + } + + /** + * donationType + * + * @param donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + * @return the current {@code OnlineDonationSettings} instance, allowing for method chaining + */ + public OnlineDonationSettings merchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + return this; + } + + public OnlineDonationSettings addMerchantAccountsItem(String merchantAccountsItem) { + if (this.merchantAccounts == null) { + this.merchantAccounts = new ArrayList<>(); + } + this.merchantAccounts.add(merchantAccountsItem); + return this; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @return merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMerchantAccounts() { + return merchantAccounts; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + * @return the current {@code OnlineDonationSettings} instance, allowing for method chaining + */ + public OnlineDonationSettings storeIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + return this; + } + + public OnlineDonationSettings addStoreIdsItem(String storeIdsItem) { + if (this.storeIds == null) { + this.storeIds = new ArrayList<>(); + } + this.storeIds.add(storeIdsItem); + return this; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @return storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStoreIds() { + return storeIds; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoreIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OnlineDonationSettings 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 OnlineDonationSettings object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnlineDonationSettings onlineDonationSettings = (OnlineDonationSettings) o; + return Objects.equals(this.defaultAmount, onlineDonationSettings.defaultAmount) + && Objects.equals(this.isSetDefaultAmount, onlineDonationSettings.isSetDefaultAmount) + && Objects.equals(this.donationType, onlineDonationSettings.donationType) + && Objects.equals(this.isSetDonationType, onlineDonationSettings.isSetDonationType) + && Objects.equals(this.merchantAccounts, onlineDonationSettings.merchantAccounts) + && Objects.equals(this.isSetMerchantAccounts, onlineDonationSettings.isSetMerchantAccounts) + && Objects.equals(this.storeIds, onlineDonationSettings.storeIds) + && Objects.equals(this.isSetStoreIds, onlineDonationSettings.isSetStoreIds); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultAmount, + isSetDefaultAmount, + donationType, + isSetDonationType, + merchantAccounts, + isSetMerchantAccounts, + storeIds, + isSetStoreIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnlineDonationSettings {\n"); + sb.append(" defaultAmount: ").append(toIndentedString(defaultAmount)).append("\n"); + sb.append(" donationType: ").append(toIndentedString(donationType)).append("\n"); + sb.append(" merchantAccounts: ").append(toIndentedString(merchantAccounts)).append("\n"); + sb.append(" storeIds: ").append(toIndentedString(storeIds)).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 (isSetDefaultAmount) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_AMOUNT, this.defaultAmount); + } + if (isSetDonationType) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TYPE, this.donationType); + } + if (isSetMerchantAccounts) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNTS, this.merchantAccounts); + } + if (isSetStoreIds) { + addIfNull(nulls, JSON_PROPERTY_STORE_IDS, this.storeIds); + } + + 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 OnlineDonationSettings given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnlineDonationSettings + * @throws JsonProcessingException if the JSON string is invalid with respect to + * OnlineDonationSettings + */ + public static OnlineDonationSettings fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OnlineDonationSettings.class); + } + + /** + * Convert an instance of OnlineDonationSettings 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/management/OnlineDonationSettingsResponse.java b/src/main/java/com/adyen/model/management/OnlineDonationSettingsResponse.java new file mode 100644 index 000000000..583982322 --- /dev/null +++ b/src/main/java/com/adyen/model/management/OnlineDonationSettingsResponse.java @@ -0,0 +1,445 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** OnlineDonationSettingsResponse */ +@JsonPropertyOrder({ + OnlineDonationSettingsResponse.JSON_PROPERTY_AMOUNTS, + OnlineDonationSettingsResponse.JSON_PROPERTY_DEFAULT_CURRENCY, + OnlineDonationSettingsResponse.JSON_PROPERTY_DONATION_TYPE, + OnlineDonationSettingsResponse.JSON_PROPERTY_MERCHANT_ACCOUNTS, + OnlineDonationSettingsResponse.JSON_PROPERTY_STORE_IDS +}) +public class OnlineDonationSettingsResponse { + public static final String JSON_PROPERTY_AMOUNTS = "amounts"; + private List amounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmounts = false; + + public static final String JSON_PROPERTY_DEFAULT_CURRENCY = "defaultCurrency"; + private String defaultCurrency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrency = false; + + public static final String JSON_PROPERTY_DONATION_TYPE = "donationType"; + private DonationType donationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationType = false; + + public static final String JSON_PROPERTY_MERCHANT_ACCOUNTS = "merchantAccounts"; + private List merchantAccounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccounts = false; + + public static final String JSON_PROPERTY_STORE_IDS = "storeIds"; + private List storeIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OnlineDonationSettingsResponse() {} + + /** + * The currency and fixed amounts for donations. We automatically add calculated amounts in other + * currencies for participating stores that use a different currency than the default. + * + * @param amounts The currency and fixed amounts for donations. We automatically add calculated + * amounts in other currencies for participating stores that use a different currency than the + * default. + * @return the current {@code OnlineDonationSettingsResponse} instance, allowing for method + * chaining + */ + public OnlineDonationSettingsResponse amounts(List amounts) { + this.amounts = amounts; + isSetAmounts = true; // mark as set + return this; + } + + public OnlineDonationSettingsResponse addAmountsItem(DonationAmount amountsItem) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.add(amountsItem); + return this; + } + + /** + * The currency and fixed amounts for donations. We automatically add calculated amounts in other + * currencies for participating stores that use a different currency than the default. + * + * @return amounts The currency and fixed amounts for donations. We automatically add calculated + * amounts in other currencies for participating stores that use a different currency than the + * default. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAmounts() { + return amounts; + } + + /** + * The currency and fixed amounts for donations. We automatically add calculated amounts in other + * currencies for participating stores that use a different currency than the default. + * + * @param amounts The currency and fixed amounts for donations. We automatically add calculated + * amounts in other currencies for participating stores that use a different currency than the + * default. + */ + @JsonProperty(JSON_PROPERTY_AMOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmounts(List amounts) { + this.amounts = amounts; + isSetAmounts = true; // mark as set + } + + /** + * The currency that was used in the request to set fixed donation amounts. Format: + * three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param defaultCurrency The currency that was used in the request to set fixed donation amounts. + * Format: three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * @return the current {@code OnlineDonationSettingsResponse} instance, allowing for method + * chaining + */ + public OnlineDonationSettingsResponse defaultCurrency(String defaultCurrency) { + this.defaultCurrency = defaultCurrency; + isSetDefaultCurrency = true; // mark as set + return this; + } + + /** + * The currency that was used in the request to set fixed donation amounts. Format: + * three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @return defaultCurrency The currency that was used in the request to set fixed donation + * amounts. Format: three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDefaultCurrency() { + return defaultCurrency; + } + + /** + * The currency that was used in the request to set fixed donation amounts. Format: + * three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * + * @param defaultCurrency The currency that was used in the request to set fixed donation amounts. + * Format: three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultCurrency(String defaultCurrency) { + this.defaultCurrency = defaultCurrency; + isSetDefaultCurrency = true; // mark as set + } + + /** + * donationType + * + * @param donationType + * @return the current {@code OnlineDonationSettingsResponse} instance, allowing for method + * chaining + */ + public OnlineDonationSettingsResponse donationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + return this; + } + + /** + * Get donationType + * + * @return donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationType getDonationType() { + return donationType; + } + + /** + * donationType + * + * @param donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + * @return the current {@code OnlineDonationSettingsResponse} instance, allowing for method + * chaining + */ + public OnlineDonationSettingsResponse merchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + return this; + } + + public OnlineDonationSettingsResponse addMerchantAccountsItem(String merchantAccountsItem) { + if (this.merchantAccounts == null) { + this.merchantAccounts = new ArrayList<>(); + } + this.merchantAccounts.add(merchantAccountsItem); + return this; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @return merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMerchantAccounts() { + return merchantAccounts; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + * @return the current {@code OnlineDonationSettingsResponse} instance, allowing for method + * chaining + */ + public OnlineDonationSettingsResponse storeIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + return this; + } + + public OnlineDonationSettingsResponse addStoreIdsItem(String storeIdsItem) { + if (this.storeIds == null) { + this.storeIds = new ArrayList<>(); + } + this.storeIds.add(storeIdsItem); + return this; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @return storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStoreIds() { + return storeIds; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoreIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OnlineDonationSettingsResponse 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 OnlineDonationSettingsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnlineDonationSettingsResponse onlineDonationSettingsResponse = + (OnlineDonationSettingsResponse) o; + return Objects.equals(this.amounts, onlineDonationSettingsResponse.amounts) + && Objects.equals(this.isSetAmounts, onlineDonationSettingsResponse.isSetAmounts) + && Objects.equals(this.defaultCurrency, onlineDonationSettingsResponse.defaultCurrency) + && Objects.equals( + this.isSetDefaultCurrency, onlineDonationSettingsResponse.isSetDefaultCurrency) + && Objects.equals(this.donationType, onlineDonationSettingsResponse.donationType) + && Objects.equals(this.isSetDonationType, onlineDonationSettingsResponse.isSetDonationType) + && Objects.equals(this.merchantAccounts, onlineDonationSettingsResponse.merchantAccounts) + && Objects.equals( + this.isSetMerchantAccounts, onlineDonationSettingsResponse.isSetMerchantAccounts) + && Objects.equals(this.storeIds, onlineDonationSettingsResponse.storeIds) + && Objects.equals(this.isSetStoreIds, onlineDonationSettingsResponse.isSetStoreIds); + } + + @Override + public int hashCode() { + return Objects.hash( + amounts, + isSetAmounts, + defaultCurrency, + isSetDefaultCurrency, + donationType, + isSetDonationType, + merchantAccounts, + isSetMerchantAccounts, + storeIds, + isSetStoreIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnlineDonationSettingsResponse {\n"); + sb.append(" amounts: ").append(toIndentedString(amounts)).append("\n"); + sb.append(" defaultCurrency: ").append(toIndentedString(defaultCurrency)).append("\n"); + sb.append(" donationType: ").append(toIndentedString(donationType)).append("\n"); + sb.append(" merchantAccounts: ").append(toIndentedString(merchantAccounts)).append("\n"); + sb.append(" storeIds: ").append(toIndentedString(storeIds)).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 (isSetAmounts) { + addIfNull(nulls, JSON_PROPERTY_AMOUNTS, this.amounts); + } + if (isSetDefaultCurrency) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY, this.defaultCurrency); + } + if (isSetDonationType) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TYPE, this.donationType); + } + if (isSetMerchantAccounts) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNTS, this.merchantAccounts); + } + if (isSetStoreIds) { + addIfNull(nulls, JSON_PROPERTY_STORE_IDS, this.storeIds); + } + + 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 OnlineDonationSettingsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnlineDonationSettingsResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * OnlineDonationSettingsResponse + */ + public static OnlineDonationSettingsResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OnlineDonationSettingsResponse.class); + } + + /** + * Convert an instance of OnlineDonationSettingsResponse 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/management/OnlineDonationSettingsUpdate.java b/src/main/java/com/adyen/model/management/OnlineDonationSettingsUpdate.java new file mode 100644 index 000000000..ee55ed165 --- /dev/null +++ b/src/main/java/com/adyen/model/management/OnlineDonationSettingsUpdate.java @@ -0,0 +1,359 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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; + +/** OnlineDonationSettingsUpdate */ +@JsonPropertyOrder({ + OnlineDonationSettingsUpdate.JSON_PROPERTY_DEFAULT_AMOUNT, + OnlineDonationSettingsUpdate.JSON_PROPERTY_DONATION_TYPE, + OnlineDonationSettingsUpdate.JSON_PROPERTY_MERCHANT_ACCOUNTS, + OnlineDonationSettingsUpdate.JSON_PROPERTY_STORE_IDS +}) +public class OnlineDonationSettingsUpdate { + public static final String JSON_PROPERTY_DEFAULT_AMOUNT = "defaultAmount"; + private DonationAmountUpdate defaultAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultAmount = false; + + public static final String JSON_PROPERTY_DONATION_TYPE = "donationType"; + private DonationType donationType; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationType = false; + + public static final String JSON_PROPERTY_MERCHANT_ACCOUNTS = "merchantAccounts"; + private List merchantAccounts; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccounts = false; + + public static final String JSON_PROPERTY_STORE_IDS = "storeIds"; + private List storeIds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OnlineDonationSettingsUpdate() {} + + /** + * defaultAmount + * + * @param defaultAmount + * @return the current {@code OnlineDonationSettingsUpdate} instance, allowing for method chaining + */ + public OnlineDonationSettingsUpdate defaultAmount(DonationAmountUpdate defaultAmount) { + this.defaultAmount = defaultAmount; + isSetDefaultAmount = true; // mark as set + return this; + } + + /** + * Get defaultAmount + * + * @return defaultAmount + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationAmountUpdate getDefaultAmount() { + return defaultAmount; + } + + /** + * defaultAmount + * + * @param defaultAmount + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultAmount(DonationAmountUpdate defaultAmount) { + this.defaultAmount = defaultAmount; + isSetDefaultAmount = true; // mark as set + } + + /** + * donationType + * + * @param donationType + * @return the current {@code OnlineDonationSettingsUpdate} instance, allowing for method chaining + */ + public OnlineDonationSettingsUpdate donationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + return this; + } + + /** + * Get donationType + * + * @return donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DonationType getDonationType() { + return donationType; + } + + /** + * donationType + * + * @param donationType + */ + @JsonProperty(JSON_PROPERTY_DONATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDonationType(DonationType donationType) { + this.donationType = donationType; + isSetDonationType = true; // mark as set + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + * @return the current {@code OnlineDonationSettingsUpdate} instance, allowing for method chaining + */ + public OnlineDonationSettingsUpdate merchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + return this; + } + + public OnlineDonationSettingsUpdate addMerchantAccountsItem(String merchantAccountsItem) { + if (this.merchantAccounts == null) { + this.merchantAccounts = new ArrayList<>(); + } + this.merchantAccounts.add(merchantAccountsItem); + return this; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @return merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMerchantAccounts() { + return merchantAccounts; + } + + /** + * The merchant accounts for this sales channel that are associated with the donation campaign. + * + * @param merchantAccounts The merchant accounts for this sales channel that are associated with + * the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + isSetMerchantAccounts = true; // mark as set + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + * @return the current {@code OnlineDonationSettingsUpdate} instance, allowing for method chaining + */ + public OnlineDonationSettingsUpdate storeIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + return this; + } + + public OnlineDonationSettingsUpdate addStoreIdsItem(String storeIdsItem) { + if (this.storeIds == null) { + this.storeIds = new ArrayList<>(); + } + this.storeIds.add(storeIdsItem); + return this; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @return storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStoreIds() { + return storeIds; + } + + /** + * The Adyen-generated unique identifiers of stores for this sales channel that are associated + * with the donation campaign. + * + * @param storeIds The Adyen-generated unique identifiers of stores for this sales channel that + * are associated with the donation campaign. + */ + @JsonProperty(JSON_PROPERTY_STORE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoreIds(List storeIds) { + this.storeIds = storeIds; + isSetStoreIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OnlineDonationSettingsUpdate 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 OnlineDonationSettingsUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnlineDonationSettingsUpdate onlineDonationSettingsUpdate = (OnlineDonationSettingsUpdate) o; + return Objects.equals(this.defaultAmount, onlineDonationSettingsUpdate.defaultAmount) + && Objects.equals(this.isSetDefaultAmount, onlineDonationSettingsUpdate.isSetDefaultAmount) + && Objects.equals(this.donationType, onlineDonationSettingsUpdate.donationType) + && Objects.equals(this.isSetDonationType, onlineDonationSettingsUpdate.isSetDonationType) + && Objects.equals(this.merchantAccounts, onlineDonationSettingsUpdate.merchantAccounts) + && Objects.equals( + this.isSetMerchantAccounts, onlineDonationSettingsUpdate.isSetMerchantAccounts) + && Objects.equals(this.storeIds, onlineDonationSettingsUpdate.storeIds) + && Objects.equals(this.isSetStoreIds, onlineDonationSettingsUpdate.isSetStoreIds); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultAmount, + isSetDefaultAmount, + donationType, + isSetDonationType, + merchantAccounts, + isSetMerchantAccounts, + storeIds, + isSetStoreIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnlineDonationSettingsUpdate {\n"); + sb.append(" defaultAmount: ").append(toIndentedString(defaultAmount)).append("\n"); + sb.append(" donationType: ").append(toIndentedString(donationType)).append("\n"); + sb.append(" merchantAccounts: ").append(toIndentedString(merchantAccounts)).append("\n"); + sb.append(" storeIds: ").append(toIndentedString(storeIds)).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 (isSetDefaultAmount) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_AMOUNT, this.defaultAmount); + } + if (isSetDonationType) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TYPE, this.donationType); + } + if (isSetMerchantAccounts) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNTS, this.merchantAccounts); + } + if (isSetStoreIds) { + addIfNull(nulls, JSON_PROPERTY_STORE_IDS, this.storeIds); + } + + 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 OnlineDonationSettingsUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnlineDonationSettingsUpdate + * @throws JsonProcessingException if the JSON string is invalid with respect to + * OnlineDonationSettingsUpdate + */ + public static OnlineDonationSettingsUpdate fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OnlineDonationSettingsUpdate.class); + } + + /** + * Convert an instance of OnlineDonationSettingsUpdate 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/management/PaymentMethod.java b/src/main/java/com/adyen/model/management/PaymentMethod.java index 20673f9ce..da6d02b24 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethod.java +++ b/src/main/java/com/adyen/model/management/PaymentMethod.java @@ -34,6 +34,7 @@ PaymentMethod.JSON_PROPERTY_ALLOWED, PaymentMethod.JSON_PROPERTY_AMEX, PaymentMethod.JSON_PROPERTY_APPLE_PAY, + PaymentMethod.JSON_PROPERTY_ASSOCIATED_PAYMENT_METHODS, PaymentMethod.JSON_PROPERTY_BCMC, PaymentMethod.JSON_PROPERTY_BUSINESS_LINE_ID, PaymentMethod.JSON_PROPERTY_CARNET, @@ -128,6 +129,12 @@ public class PaymentMethod { /** Mark when the attribute has been explicitly set. */ private boolean isSetApplePay = false; + public static final String JSON_PROPERTY_ASSOCIATED_PAYMENT_METHODS = "associatedPaymentMethods"; + private List associatedPaymentMethods; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssociatedPaymentMethods = false; + public static final String JSON_PROPERTY_BCMC = "bcmc"; private BcmcResponseInfo bcmc; @@ -734,6 +741,54 @@ public void setApplePay(ApplePayResponseInfo applePay) { isSetApplePay = true; // mark as set } + /** + * Payment methods that were also updated as part of an associated transition. + * + * @param associatedPaymentMethods Payment methods that were also updated as part of an associated + * transition. + * @return the current {@code PaymentMethod} instance, allowing for method chaining + */ + public PaymentMethod associatedPaymentMethods( + List associatedPaymentMethods) { + this.associatedPaymentMethods = associatedPaymentMethods; + isSetAssociatedPaymentMethods = true; // mark as set + return this; + } + + public PaymentMethod addAssociatedPaymentMethodsItem( + AssociatedPaymentMethod associatedPaymentMethodsItem) { + if (this.associatedPaymentMethods == null) { + this.associatedPaymentMethods = new ArrayList<>(); + } + this.associatedPaymentMethods.add(associatedPaymentMethodsItem); + return this; + } + + /** + * Payment methods that were also updated as part of an associated transition. + * + * @return associatedPaymentMethods Payment methods that were also updated as part of an + * associated transition. + */ + @JsonProperty(JSON_PROPERTY_ASSOCIATED_PAYMENT_METHODS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAssociatedPaymentMethods() { + return associatedPaymentMethods; + } + + /** + * Payment methods that were also updated as part of an associated transition. + * + * @param associatedPaymentMethods Payment methods that were also updated as part of an associated + * transition. + */ + @JsonProperty(JSON_PROPERTY_ASSOCIATED_PAYMENT_METHODS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAssociatedPaymentMethods(List associatedPaymentMethods) { + this.associatedPaymentMethods = associatedPaymentMethods; + isSetAssociatedPaymentMethods = true; // mark as set + } + /** * bcmc * @@ -2596,6 +2651,9 @@ public boolean equals(Object o) { && Objects.equals(this.isSetAmex, paymentMethod.isSetAmex) && Objects.equals(this.applePay, paymentMethod.applePay) && Objects.equals(this.isSetApplePay, paymentMethod.isSetApplePay) + && Objects.equals(this.associatedPaymentMethods, paymentMethod.associatedPaymentMethods) + && Objects.equals( + this.isSetAssociatedPaymentMethods, paymentMethod.isSetAssociatedPaymentMethods) && Objects.equals(this.bcmc, paymentMethod.bcmc) && Objects.equals(this.isSetBcmc, paymentMethod.isSetBcmc) && Objects.equals(this.businessLineId, paymentMethod.businessLineId) @@ -2715,6 +2773,8 @@ public int hashCode() { isSetAmex, applePay, isSetApplePay, + associatedPaymentMethods, + isSetAssociatedPaymentMethods, bcmc, isSetBcmc, businessLineId, @@ -2828,6 +2888,9 @@ public String toString() { sb.append(" allowed: ").append(toIndentedString(allowed)).append("\n"); sb.append(" amex: ").append(toIndentedString(amex)).append("\n"); sb.append(" applePay: ").append(toIndentedString(applePay)).append("\n"); + sb.append(" associatedPaymentMethods: ") + .append(toIndentedString(associatedPaymentMethods)) + .append("\n"); sb.append(" bcmc: ").append(toIndentedString(bcmc)).append("\n"); sb.append(" businessLineId: ").append(toIndentedString(businessLineId)).append("\n"); sb.append(" carnet: ").append(toIndentedString(carnet)).append("\n"); @@ -2923,6 +2986,9 @@ public Map getExplicitNulls() { if (isSetApplePay) { addIfNull(nulls, JSON_PROPERTY_APPLE_PAY, this.applePay); } + if (isSetAssociatedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ASSOCIATED_PAYMENT_METHODS, this.associatedPaymentMethods); + } if (isSetBcmc) { addIfNull(nulls, JSON_PROPERTY_BCMC, this.bcmc); } diff --git a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java index 08b5e21a8..678ad38d0 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java @@ -138,6 +138,8 @@ public enum TypesWithErrorsEnum { CARTEBANCAIRE(String.valueOf("cartebancaire")), + CASHAPP(String.valueOf("cashapp")), + CLEARPAY(String.valueOf("clearpay")), CLICKTOPAY(String.valueOf("clicktopay")), diff --git a/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java b/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java index 97c320843..5b1cffefe 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java @@ -131,7 +131,7 @@ public class PaymentMethodSetupInfo { private boolean isSetBusinessLineId = false; public static final String JSON_PROPERTY_CARNET = "carnet"; - private GenericPmWithTdiInfo carnet; + private CarnetInfo carnet; /** Mark when the attribute has been explicitly set. */ private boolean isSetCarnet = false; @@ -497,6 +497,8 @@ public enum TypeEnum { CARTEBANCAIRE(String.valueOf("cartebancaire")), + CASHAPP(String.valueOf("cashapp")), + CLEARPAY(String.valueOf("clearpay")), CLICKTOPAY(String.valueOf("clicktopay")), @@ -1084,7 +1086,7 @@ public void setBusinessLineId(String businessLineId) { * @param carnet * @return the current {@code PaymentMethodSetupInfo} instance, allowing for method chaining */ - public PaymentMethodSetupInfo carnet(GenericPmWithTdiInfo carnet) { + public PaymentMethodSetupInfo carnet(CarnetInfo carnet) { this.carnet = carnet; isSetCarnet = true; // mark as set return this; @@ -1097,7 +1099,7 @@ public PaymentMethodSetupInfo carnet(GenericPmWithTdiInfo carnet) { */ @JsonProperty(JSON_PROPERTY_CARNET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public GenericPmWithTdiInfo getCarnet() { + public CarnetInfo getCarnet() { return carnet; } @@ -1108,7 +1110,7 @@ public GenericPmWithTdiInfo getCarnet() { */ @JsonProperty(JSON_PROPERTY_CARNET) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCarnet(GenericPmWithTdiInfo carnet) { + public void setCarnet(CarnetInfo carnet) { this.carnet = carnet; isSetCarnet = true; // mark as set } diff --git a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java index 3381a85ad..144a7d2b0 100644 --- a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java +++ b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java @@ -317,6 +317,24 @@ public ScheduleTerminalActionsRequestActionDetails(UninstallAndroidCertificateDe new GenericType() {}); JSON.registerDescendants( ScheduleTerminalActionsRequestActionDetails.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("ForceReboot", ForceRebootDetails.class); + mappings.put("InstallAndroidApp", InstallAndroidAppDetails.class); + mappings.put("InstallAndroidCertificate", InstallAndroidCertificateDetails.class); + mappings.put("ReleaseUpdate", ReleaseUpdateDetails.class); + mappings.put("UninstallAndroidApp", UninstallAndroidAppDetails.class); + mappings.put("UninstallAndroidCertificate", UninstallAndroidCertificateDetails.class); + mappings.put("ForceRebootDetails", ForceRebootDetails.class); + mappings.put("InstallAndroidAppDetails", InstallAndroidAppDetails.class); + mappings.put("InstallAndroidCertificateDetails", InstallAndroidCertificateDetails.class); + mappings.put("ReleaseUpdateDetails", ReleaseUpdateDetails.class); + mappings.put("UninstallAndroidAppDetails", UninstallAndroidAppDetails.class); + mappings.put("UninstallAndroidCertificateDetails", UninstallAndroidCertificateDetails.class); + mappings.put( + "ScheduleTerminalActionsRequest_actionDetails", + ScheduleTerminalActionsRequestActionDetails.class); + JSON.registerDiscriminator(ScheduleTerminalActionsRequestActionDetails.class, "type", mappings); } @Override diff --git a/src/main/java/com/adyen/model/management/SplitConfigurationLogic.java b/src/main/java/com/adyen/model/management/SplitConfigurationLogic.java index c8c94310c..a2481da75 100644 --- a/src/main/java/com/adyen/model/management/SplitConfigurationLogic.java +++ b/src/main/java/com/adyen/model/management/SplitConfigurationLogic.java @@ -33,6 +33,7 @@ SplitConfigurationLogic.JSON_PROPERTY_CHARGEBACK, SplitConfigurationLogic.JSON_PROPERTY_CHARGEBACK_COST_ALLOCATION, SplitConfigurationLogic.JSON_PROPERTY_COMMISSION, + SplitConfigurationLogic.JSON_PROPERTY_DCC, SplitConfigurationLogic.JSON_PROPERTY_INTERCHANGE, SplitConfigurationLogic.JSON_PROPERTY_PAYMENT_FEE, SplitConfigurationLogic.JSON_PROPERTY_REFUND, @@ -364,6 +365,12 @@ public static ChargebackCostAllocationEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetCommission = false; + public static final String JSON_PROPERTY_DCC = "dcc"; + private SplitDcc dcc; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDcc = false; + /** * Deducts the interchange fee from specified balance account. Possible values: * **deductFromLiableAccount**, **deductFromOneBalanceAccount**. @@ -1158,6 +1165,41 @@ public void setCommission(Commission commission) { isSetCommission = true; // mark as set } + /** + * dcc + * + * @param dcc + * @return the current {@code SplitConfigurationLogic} instance, allowing for method chaining + */ + public SplitConfigurationLogic dcc(SplitDcc dcc) { + this.dcc = dcc; + isSetDcc = true; // mark as set + return this; + } + + /** + * Get dcc + * + * @return dcc + */ + @JsonProperty(JSON_PROPERTY_DCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SplitDcc getDcc() { + return dcc; + } + + /** + * dcc + * + * @param dcc + */ + @JsonProperty(JSON_PROPERTY_DCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDcc(SplitDcc dcc) { + this.dcc = dcc; + isSetDcc = true; // mark as set + } + /** * Deducts the interchange fee from specified balance account. Possible values: * **deductFromLiableAccount**, **deductFromOneBalanceAccount**. @@ -1688,6 +1730,8 @@ public boolean equals(Object o) { splitConfigurationLogic.isSetChargebackCostAllocation) && Objects.equals(this.commission, splitConfigurationLogic.commission) && Objects.equals(this.isSetCommission, splitConfigurationLogic.isSetCommission) + && Objects.equals(this.dcc, splitConfigurationLogic.dcc) + && Objects.equals(this.isSetDcc, splitConfigurationLogic.isSetDcc) && Objects.equals(this.interchange, splitConfigurationLogic.interchange) && Objects.equals(this.isSetInterchange, splitConfigurationLogic.isSetInterchange) && Objects.equals(this.paymentFee, splitConfigurationLogic.paymentFee) @@ -1728,6 +1772,8 @@ public int hashCode() { isSetChargebackCostAllocation, commission, isSetCommission, + dcc, + isSetDcc, interchange, isSetInterchange, paymentFee, @@ -1764,6 +1810,7 @@ public String toString() { .append(toIndentedString(chargebackCostAllocation)) .append("\n"); sb.append(" commission: ").append(toIndentedString(commission)).append("\n"); + sb.append(" dcc: ").append(toIndentedString(dcc)).append("\n"); sb.append(" interchange: ").append(toIndentedString(interchange)).append("\n"); sb.append(" paymentFee: ").append(toIndentedString(paymentFee)).append("\n"); sb.append(" refund: ").append(toIndentedString(refund)).append("\n"); @@ -1823,6 +1870,9 @@ public Map getExplicitNulls() { if (isSetCommission) { addIfNull(nulls, JSON_PROPERTY_COMMISSION, this.commission); } + if (isSetDcc) { + addIfNull(nulls, JSON_PROPERTY_DCC, this.dcc); + } if (isSetInterchange) { addIfNull(nulls, JSON_PROPERTY_INTERCHANGE, this.interchange); } diff --git a/src/main/java/com/adyen/model/management/SplitDcc.java b/src/main/java/com/adyen/model/management/SplitDcc.java new file mode 100644 index 000000000..9b0514a6d --- /dev/null +++ b/src/main/java/com/adyen/model/management/SplitDcc.java @@ -0,0 +1,177 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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.*; + +/** SplitDcc */ +@JsonPropertyOrder({SplitDcc.JSON_PROPERTY_ACCOUNT_HOLDER_PERCENTAGE}) +public class SplitDcc { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_PERCENTAGE = "accountHolderPercentage"; + private Long accountHolderPercentage; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderPercentage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SplitDcc() {} + + /** + * accountHolderPercentage + * + * @param accountHolderPercentage + * @return the current {@code SplitDcc} instance, allowing for method chaining + */ + public SplitDcc accountHolderPercentage(Long accountHolderPercentage) { + this.accountHolderPercentage = accountHolderPercentage; + isSetAccountHolderPercentage = true; // mark as set + return this; + } + + /** + * Get accountHolderPercentage + * + * @return accountHolderPercentage + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getAccountHolderPercentage() { + return accountHolderPercentage; + } + + /** + * accountHolderPercentage + * + * @param accountHolderPercentage + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER_PERCENTAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolderPercentage(Long accountHolderPercentage) { + this.accountHolderPercentage = accountHolderPercentage; + isSetAccountHolderPercentage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SplitDcc 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 SplitDcc object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SplitDcc splitDcc = (SplitDcc) o; + return Objects.equals(this.accountHolderPercentage, splitDcc.accountHolderPercentage) + && Objects.equals(this.isSetAccountHolderPercentage, splitDcc.isSetAccountHolderPercentage); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolderPercentage, isSetAccountHolderPercentage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SplitDcc {\n"); + sb.append(" accountHolderPercentage: ") + .append(toIndentedString(accountHolderPercentage)) + .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 (isSetAccountHolderPercentage) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_PERCENTAGE, this.accountHolderPercentage); + } + + 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 SplitDcc given an JSON string + * + * @param jsonString JSON string + * @return An instance of SplitDcc + * @throws JsonProcessingException if the JSON string is invalid with respect to SplitDcc + */ + public static SplitDcc fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SplitDcc.class); + } + + /** + * Convert an instance of SplitDcc 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/management/Surcharge.java b/src/main/java/com/adyen/model/management/Surcharge.java index ab37fe0c0..e5a6ade25 100644 --- a/src/main/java/com/adyen/model/management/Surcharge.java +++ b/src/main/java/com/adyen/model/management/Surcharge.java @@ -25,6 +25,7 @@ @JsonPropertyOrder({ Surcharge.JSON_PROPERTY_ASK_CONFIRMATION, Surcharge.JSON_PROPERTY_CONFIGURATIONS, + Surcharge.JSON_PROPERTY_DISCLOSURE_ON_PRESENT_CARD, Surcharge.JSON_PROPERTY_EXCLUDE_GRATUITY_FROM_SURCHARGE }) public class Surcharge { @@ -40,6 +41,12 @@ public class Surcharge { /** Mark when the attribute has been explicitly set. */ private boolean isSetConfigurations = false; + public static final String JSON_PROPERTY_DISCLOSURE_ON_PRESENT_CARD = "disclosureOnPresentCard"; + private Boolean disclosureOnPresentCard; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisclosureOnPresentCard = false; + public static final String JSON_PROPERTY_EXCLUDE_GRATUITY_FROM_SURCHARGE = "excludeGratuityFromSurcharge"; private Boolean excludeGratuityFromSurcharge; @@ -139,6 +146,44 @@ public void setConfigurations(List configurations) { isSetConfigurations = true; // mark as set } + /** + * Show the maximum surcharge rate to the shopper on the present card screen before they tap. + * + * @param disclosureOnPresentCard Show the maximum surcharge rate to the shopper on the present + * card screen before they tap. + * @return the current {@code Surcharge} instance, allowing for method chaining + */ + public Surcharge disclosureOnPresentCard(Boolean disclosureOnPresentCard) { + this.disclosureOnPresentCard = disclosureOnPresentCard; + isSetDisclosureOnPresentCard = true; // mark as set + return this; + } + + /** + * Show the maximum surcharge rate to the shopper on the present card screen before they tap. + * + * @return disclosureOnPresentCard Show the maximum surcharge rate to the shopper on the present + * card screen before they tap. + */ + @JsonProperty(JSON_PROPERTY_DISCLOSURE_ON_PRESENT_CARD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisclosureOnPresentCard() { + return disclosureOnPresentCard; + } + + /** + * Show the maximum surcharge rate to the shopper on the present card screen before they tap. + * + * @param disclosureOnPresentCard Show the maximum surcharge rate to the shopper on the present + * card screen before they tap. + */ + @JsonProperty(JSON_PROPERTY_DISCLOSURE_ON_PRESENT_CARD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisclosureOnPresentCard(Boolean disclosureOnPresentCard) { + this.disclosureOnPresentCard = disclosureOnPresentCard; + isSetDisclosureOnPresentCard = true; // mark as set + } + /** * Exclude the tip amount from the surcharge calculation. * @@ -208,6 +253,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetAskConfirmation, surcharge.isSetAskConfirmation) && Objects.equals(this.configurations, surcharge.configurations) && Objects.equals(this.isSetConfigurations, surcharge.isSetConfigurations) + && Objects.equals(this.disclosureOnPresentCard, surcharge.disclosureOnPresentCard) + && Objects.equals(this.isSetDisclosureOnPresentCard, surcharge.isSetDisclosureOnPresentCard) && Objects.equals(this.excludeGratuityFromSurcharge, surcharge.excludeGratuityFromSurcharge) && Objects.equals( this.isSetExcludeGratuityFromSurcharge, surcharge.isSetExcludeGratuityFromSurcharge); @@ -220,6 +267,8 @@ public int hashCode() { isSetAskConfirmation, configurations, isSetConfigurations, + disclosureOnPresentCard, + isSetDisclosureOnPresentCard, excludeGratuityFromSurcharge, isSetExcludeGratuityFromSurcharge); } @@ -230,6 +279,9 @@ public String toString() { sb.append("class Surcharge {\n"); sb.append(" askConfirmation: ").append(toIndentedString(askConfirmation)).append("\n"); sb.append(" configurations: ").append(toIndentedString(configurations)).append("\n"); + sb.append(" disclosureOnPresentCard: ") + .append(toIndentedString(disclosureOnPresentCard)) + .append("\n"); sb.append(" excludeGratuityFromSurcharge: ") .append(toIndentedString(excludeGratuityFromSurcharge)) .append("\n"); @@ -263,6 +315,9 @@ public Map getExplicitNulls() { if (isSetConfigurations) { addIfNull(nulls, JSON_PROPERTY_CONFIGURATIONS, this.configurations); } + if (isSetDisclosureOnPresentCard) { + addIfNull(nulls, JSON_PROPERTY_DISCLOSURE_ON_PRESENT_CARD, this.disclosureOnPresentCard); + } if (isSetExcludeGratuityFromSurcharge) { addIfNull( nulls, JSON_PROPERTY_EXCLUDE_GRATUITY_FROM_SURCHARGE, this.excludeGratuityFromSurcharge); diff --git a/src/main/java/com/adyen/model/management/Unreferenced.java b/src/main/java/com/adyen/model/management/Unreferenced.java index 0b04f0a35..e1c26af57 100644 --- a/src/main/java/com/adyen/model/management/Unreferenced.java +++ b/src/main/java/com/adyen/model/management/Unreferenced.java @@ -38,10 +38,17 @@ public class Unreferenced { public Unreferenced() {} /** - * Indicates whether unreferenced refunds are enabled on the terminal. + * Indicates whether unreferenced refunds are enabled on the terminal. > You're fully + * liable for losses resulting from fraudulent or duplicate unreferenced refunds. We recommend + * that you [set an unreferenced refund limit and a refund + * delay](https://docs.adyen.com/point-of-sale/basic-tapi-integration/refund-payment/unreferenced/#risk-with-unreferenced-refunds) + * to reduce this risk. * * @param enableUnreferencedRefunds Indicates whether unreferenced refunds are enabled on the - * terminal. + * terminal. > You're fully liable for losses resulting from fraudulent or duplicate + * unreferenced refunds. We recommend that you [set an unreferenced refund limit and a refund + * delay](https://docs.adyen.com/point-of-sale/basic-tapi-integration/refund-payment/unreferenced/#risk-with-unreferenced-refunds) + * to reduce this risk. * @return the current {@code Unreferenced} instance, allowing for method chaining */ public Unreferenced enableUnreferencedRefunds(Boolean enableUnreferencedRefunds) { @@ -51,10 +58,17 @@ public Unreferenced enableUnreferencedRefunds(Boolean enableUnreferencedRefunds) } /** - * Indicates whether unreferenced refunds are enabled on the terminal. + * Indicates whether unreferenced refunds are enabled on the terminal. > You're fully + * liable for losses resulting from fraudulent or duplicate unreferenced refunds. We recommend + * that you [set an unreferenced refund limit and a refund + * delay](https://docs.adyen.com/point-of-sale/basic-tapi-integration/refund-payment/unreferenced/#risk-with-unreferenced-refunds) + * to reduce this risk. * * @return enableUnreferencedRefunds Indicates whether unreferenced refunds are enabled on the - * terminal. + * terminal. > You're fully liable for losses resulting from fraudulent or duplicate + * unreferenced refunds. We recommend that you [set an unreferenced refund limit and a refund + * delay](https://docs.adyen.com/point-of-sale/basic-tapi-integration/refund-payment/unreferenced/#risk-with-unreferenced-refunds) + * to reduce this risk. */ @JsonProperty(JSON_PROPERTY_ENABLE_UNREFERENCED_REFUNDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -63,10 +77,17 @@ public Boolean getEnableUnreferencedRefunds() { } /** - * Indicates whether unreferenced refunds are enabled on the terminal. + * Indicates whether unreferenced refunds are enabled on the terminal. > You're fully + * liable for losses resulting from fraudulent or duplicate unreferenced refunds. We recommend + * that you [set an unreferenced refund limit and a refund + * delay](https://docs.adyen.com/point-of-sale/basic-tapi-integration/refund-payment/unreferenced/#risk-with-unreferenced-refunds) + * to reduce this risk. * * @param enableUnreferencedRefunds Indicates whether unreferenced refunds are enabled on the - * terminal. + * terminal. > You're fully liable for losses resulting from fraudulent or duplicate + * unreferenced refunds. We recommend that you [set an unreferenced refund limit and a refund + * delay](https://docs.adyen.com/point-of-sale/basic-tapi-integration/refund-payment/unreferenced/#risk-with-unreferenced-refunds) + * to reduce this risk. */ @JsonProperty(JSON_PROPERTY_ENABLE_UNREFERENCED_REFUNDS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java b/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java index 44cfd677c..f08b64461 100644 --- a/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java +++ b/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java @@ -28,6 +28,7 @@ UpdatePaymentMethodInfo.JSON_PROPERTY_BCMC, UpdatePaymentMethodInfo.JSON_PROPERTY_CARNET, UpdatePaymentMethodInfo.JSON_PROPERTY_CARTES_BANCAIRES, + UpdatePaymentMethodInfo.JSON_PROPERTY_CASHAPP, UpdatePaymentMethodInfo.JSON_PROPERTY_COUNTRIES, UpdatePaymentMethodInfo.JSON_PROPERTY_CUP, UpdatePaymentMethodInfo.JSON_PROPERTY_CURRENCIES, @@ -84,6 +85,12 @@ public class UpdatePaymentMethodInfo { /** Mark when the attribute has been explicitly set. */ private boolean isSetCartesBancaires = false; + public static final String JSON_PROPERTY_CASHAPP = "cashapp"; + private CashAppUpdateInfo cashapp; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCashapp = false; + public static final String JSON_PROPERTY_COUNTRIES = "countries"; private List countries; @@ -412,6 +419,41 @@ public void setCartesBancaires(CartesBancairesUpdateInfo cartesBancaires) { isSetCartesBancaires = true; // mark as set } + /** + * cashapp + * + * @param cashapp + * @return the current {@code UpdatePaymentMethodInfo} instance, allowing for method chaining + */ + public UpdatePaymentMethodInfo cashapp(CashAppUpdateInfo cashapp) { + this.cashapp = cashapp; + isSetCashapp = true; // mark as set + return this; + } + + /** + * Get cashapp + * + * @return cashapp + */ + @JsonProperty(JSON_PROPERTY_CASHAPP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CashAppUpdateInfo getCashapp() { + return cashapp; + } + + /** + * cashapp + * + * @param cashapp + */ + @JsonProperty(JSON_PROPERTY_CASHAPP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCashapp(CashAppUpdateInfo cashapp) { + this.cashapp = cashapp; + isSetCashapp = true; // mark as set + } + /** * The list of countries where a payment method is available. By default, all countries supported * by the payment method. @@ -1348,6 +1390,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetCarnet, updatePaymentMethodInfo.isSetCarnet) && Objects.equals(this.cartesBancaires, updatePaymentMethodInfo.cartesBancaires) && Objects.equals(this.isSetCartesBancaires, updatePaymentMethodInfo.isSetCartesBancaires) + && Objects.equals(this.cashapp, updatePaymentMethodInfo.cashapp) + && Objects.equals(this.isSetCashapp, updatePaymentMethodInfo.isSetCashapp) && Objects.equals(this.countries, updatePaymentMethodInfo.countries) && Objects.equals(this.isSetCountries, updatePaymentMethodInfo.isSetCountries) && Objects.equals(this.cup, updatePaymentMethodInfo.cup) @@ -1412,6 +1456,8 @@ public int hashCode() { isSetCarnet, cartesBancaires, isSetCartesBancaires, + cashapp, + isSetCashapp, countries, isSetCountries, cup, @@ -1471,6 +1517,7 @@ public String toString() { sb.append(" bcmc: ").append(toIndentedString(bcmc)).append("\n"); sb.append(" carnet: ").append(toIndentedString(carnet)).append("\n"); sb.append(" cartesBancaires: ").append(toIndentedString(cartesBancaires)).append("\n"); + sb.append(" cashapp: ").append(toIndentedString(cashapp)).append("\n"); sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); sb.append(" cup: ").append(toIndentedString(cup)).append("\n"); sb.append(" currencies: ").append(toIndentedString(currencies)).append("\n"); @@ -1534,6 +1581,9 @@ public Map getExplicitNulls() { if (isSetCartesBancaires) { addIfNull(nulls, JSON_PROPERTY_CARTES_BANCAIRES, this.cartesBancaires); } + if (isSetCashapp) { + addIfNull(nulls, JSON_PROPERTY_CASHAPP, this.cashapp); + } if (isSetCountries) { addIfNull(nulls, JSON_PROPERTY_COUNTRIES, this.countries); } diff --git a/src/main/java/com/adyen/model/management/UpdateSplitConfigurationLogicRequest.java b/src/main/java/com/adyen/model/management/UpdateSplitConfigurationLogicRequest.java index 4f7932cf4..fb2a3b112 100644 --- a/src/main/java/com/adyen/model/management/UpdateSplitConfigurationLogicRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateSplitConfigurationLogicRequest.java @@ -33,6 +33,7 @@ UpdateSplitConfigurationLogicRequest.JSON_PROPERTY_CHARGEBACK, UpdateSplitConfigurationLogicRequest.JSON_PROPERTY_CHARGEBACK_COST_ALLOCATION, UpdateSplitConfigurationLogicRequest.JSON_PROPERTY_COMMISSION, + UpdateSplitConfigurationLogicRequest.JSON_PROPERTY_DCC, UpdateSplitConfigurationLogicRequest.JSON_PROPERTY_INTERCHANGE, UpdateSplitConfigurationLogicRequest.JSON_PROPERTY_PAYMENT_FEE, UpdateSplitConfigurationLogicRequest.JSON_PROPERTY_REFUND, @@ -364,6 +365,12 @@ public static ChargebackCostAllocationEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetCommission = false; + public static final String JSON_PROPERTY_DCC = "dcc"; + private SplitDcc dcc; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDcc = false; + /** * Deducts the interchange fee from specified balance account. Possible values: * **deductFromLiableAccount**, **deductFromOneBalanceAccount**. @@ -1168,6 +1175,42 @@ public void setCommission(Commission commission) { isSetCommission = true; // mark as set } + /** + * dcc + * + * @param dcc + * @return the current {@code UpdateSplitConfigurationLogicRequest} instance, allowing for method + * chaining + */ + public UpdateSplitConfigurationLogicRequest dcc(SplitDcc dcc) { + this.dcc = dcc; + isSetDcc = true; // mark as set + return this; + } + + /** + * Get dcc + * + * @return dcc + */ + @JsonProperty(JSON_PROPERTY_DCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SplitDcc getDcc() { + return dcc; + } + + /** + * dcc + * + * @param dcc + */ + @JsonProperty(JSON_PROPERTY_DCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDcc(SplitDcc dcc) { + this.dcc = dcc; + isSetDcc = true; // mark as set + } + /** * Deducts the interchange fee from specified balance account. Possible values: * **deductFromLiableAccount**, **deductFromOneBalanceAccount**. @@ -1716,6 +1759,8 @@ public boolean equals(Object o) { && Objects.equals(this.commission, updateSplitConfigurationLogicRequest.commission) && Objects.equals( this.isSetCommission, updateSplitConfigurationLogicRequest.isSetCommission) + && Objects.equals(this.dcc, updateSplitConfigurationLogicRequest.dcc) + && Objects.equals(this.isSetDcc, updateSplitConfigurationLogicRequest.isSetDcc) && Objects.equals(this.interchange, updateSplitConfigurationLogicRequest.interchange) && Objects.equals( this.isSetInterchange, updateSplitConfigurationLogicRequest.isSetInterchange) @@ -1761,6 +1806,8 @@ public int hashCode() { isSetChargebackCostAllocation, commission, isSetCommission, + dcc, + isSetDcc, interchange, isSetInterchange, paymentFee, @@ -1797,6 +1844,7 @@ public String toString() { .append(toIndentedString(chargebackCostAllocation)) .append("\n"); sb.append(" commission: ").append(toIndentedString(commission)).append("\n"); + sb.append(" dcc: ").append(toIndentedString(dcc)).append("\n"); sb.append(" interchange: ").append(toIndentedString(interchange)).append("\n"); sb.append(" paymentFee: ").append(toIndentedString(paymentFee)).append("\n"); sb.append(" refund: ").append(toIndentedString(refund)).append("\n"); @@ -1856,6 +1904,9 @@ public Map getExplicitNulls() { if (isSetCommission) { addIfNull(nulls, JSON_PROPERTY_COMMISSION, this.commission); } + if (isSetDcc) { + addIfNull(nulls, JSON_PROPERTY_DCC, this.dcc); + } if (isSetInterchange) { addIfNull(nulls, JSON_PROPERTY_INTERCHANGE, this.interchange); } diff --git a/src/main/java/com/adyen/service/management/DonationCampaignsApi.java b/src/main/java/com/adyen/service/management/DonationCampaignsApi.java new file mode 100644 index 000000000..644ae6dbc --- /dev/null +++ b/src/main/java/com/adyen/service/management/DonationCampaignsApi.java @@ -0,0 +1,415 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.RequestOptions; +import com.adyen.model.management.CampaignStatusTransition; +import com.adyen.model.management.DonationCampaign; +import com.adyen.model.management.DonationCampaignRequest; +import com.adyen.model.management.DonationCampaignUpdate; +import com.adyen.model.management.ListDonationCampaignsResponse; +import com.adyen.model.management.ListNonprofitsRequest; +import com.adyen.model.management.ListNonprofitsResponse; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DonationCampaignsApi extends Service { + + public static final String API_VERSION = "3"; + + protected String baseURL; + + /** + * Donation campaigns constructor in {@link com.adyen.service.management package}. + * + * @param client {@link Client } (required) + */ + public DonationCampaignsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v3"); + } + + /** + * Donation campaigns constructor in {@link com.adyen.service.management 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 DonationCampaignsApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Create a donation campaign + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param donationCampaignRequest {@link DonationCampaignRequest } (required) + * @return {@link DonationCampaign } + * @throws ApiException if fails to make API call + */ + public DonationCampaign createDonationCampaign( + String companyId, DonationCampaignRequest donationCampaignRequest) + throws ApiException, IOException { + return createDonationCampaign(companyId, donationCampaignRequest, null); + } + + /** + * Create a donation campaign + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param donationCampaignRequest {@link DonationCampaignRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link DonationCampaign } + * @throws ApiException if fails to make API call + */ + public DonationCampaign createDonationCampaign( + String companyId, + DonationCampaignRequest donationCampaignRequest, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (companyId == null) { + throw new IllegalArgumentException("Please provide the companyId path parameter"); + } + pathParams.put("companyId", companyId); + + String requestBody = donationCampaignRequest.toJson(); + Resource resource = + new Resource(this, this.baseURL + "/companies/{companyId}/campaignManagement", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return DonationCampaign.fromJson(jsonResult); + } + + /** + * Delete a donation campaign + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param donationCampaignId {@link String } The unique identifier of the donation campaign to be + * deleted. (required) + * @throws ApiException if fails to make API call + */ + public void deleteDonationCampaign(String companyId, String donationCampaignId) + throws ApiException, IOException { + deleteDonationCampaign(companyId, donationCampaignId, null); + } + + /** + * Delete a donation campaign + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param donationCampaignId {@link String } The unique identifier of the donation campaign to be + * deleted. (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 deleteDonationCampaign( + String companyId, String donationCampaignId, RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (companyId == null) { + throw new IllegalArgumentException("Please provide the companyId path parameter"); + } + pathParams.put("companyId", companyId); + if (donationCampaignId == null) { + throw new IllegalArgumentException("Please provide the donationCampaignId path parameter"); + } + pathParams.put("donationCampaignId", donationCampaignId); + + String requestBody = null; + Resource resource = + new Resource( + this, + this.baseURL + "/companies/{companyId}/campaignManagement/{donationCampaignId}", + null); + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get the donation campaigns for an account holder + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param accountHolderId {@link String } The unique identifier of the account holder. (required) + * @return {@link ListDonationCampaignsResponse } + * @throws ApiException if fails to make API call + */ + public ListDonationCampaignsResponse listDonationCampaignsForAccountHolder( + String companyId, String accountHolderId) throws ApiException, IOException { + return listDonationCampaignsForAccountHolder( + companyId, accountHolderId, null, null, null, null); + } + + /** + * Get the donation campaigns for an account holder + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param accountHolderId {@link String } The unique identifier of the account holder. (required) + * @param status {@link String } Query: The campaign status to return campaigns that match. + * Allowed values: **inactive**, **active**, or **ended**. (optional) + * @param pageNumber {@link Integer } Query: The number of the page to fetch. (optional, default + * to 1) + * @param pageSize {@link Integer } Query: The number of items to have on a page, maximum 100. The + * default is 10 items on a page. (optional, default to 10) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link ListDonationCampaignsResponse } + * @throws ApiException if fails to make API call + */ + public ListDonationCampaignsResponse listDonationCampaignsForAccountHolder( + String companyId, + String accountHolderId, + String status, + Integer pageNumber, + Integer pageSize, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (companyId == null) { + throw new IllegalArgumentException("Please provide the companyId path parameter"); + } + pathParams.put("companyId", companyId); + if (accountHolderId == null) { + throw new IllegalArgumentException("Please provide the accountHolderId path parameter"); + } + pathParams.put("accountHolderId", accountHolderId); + + // Add query params + Map queryParams = new HashMap<>(); + if (status != null) { + queryParams.put("status", status); + } + if (pageNumber != null) { + queryParams.put("pageNumber", pageNumber.toString()); + } + if (pageSize != null) { + queryParams.put("pageSize", pageSize.toString()); + } + + String requestBody = null; + Resource resource = + new Resource( + this, + this.baseURL + + "/companies/{companyId}/campaignManagement/accountHolders/{accountHolderId}", + null); + String jsonResult = + resource.request( + requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListDonationCampaignsResponse.fromJson(jsonResult); + } + + /** + * Get a list of nonprofits + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param listNonprofitsRequest {@link ListNonprofitsRequest } (required) + * @return {@link ListNonprofitsResponse } + * @throws ApiException if fails to make API call + */ + public ListNonprofitsResponse listNonprofits( + String companyId, ListNonprofitsRequest listNonprofitsRequest) + throws ApiException, IOException { + return listNonprofits(companyId, null, null, null, null, listNonprofitsRequest, null); + } + + /** + * Get a list of nonprofits + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param listNonprofitsRequest {@link ListNonprofitsRequest } (required) + * @param searchTerm {@link String } Query: A query to return nonprofit organizations for, maximum + * 100 characters. For example, `&searchTerm=clean%20water`. (optional) + * @param pageNumber {@link Integer } Query: The number of the page to fetch. (optional) + * @param pageSize {@link Integer } Query: The number of items to have on a page, maximum 100. The + * default is 10 items on a page. (optional, default to 10) + * @param goal {@code List } Query: One or more United Nations Sustainable Development + * Goals to return nonprofit organizations for. Format: `unsdg_<number>`, for + * example, `&goal=unsdg_6&goal=unsdg_2`. (optional + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link ListNonprofitsResponse } + * @throws ApiException if fails to make API call + */ + public ListNonprofitsResponse listNonprofits( + String companyId, + String searchTerm, + Integer pageNumber, + Integer pageSize, + List goal, + ListNonprofitsRequest listNonprofitsRequest, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (companyId == null) { + throw new IllegalArgumentException("Please provide the companyId path parameter"); + } + pathParams.put("companyId", companyId); + + // Add query params + Map queryParams = new HashMap<>(); + if (searchTerm != null) { + queryParams.put("searchTerm", searchTerm); + } + if (pageNumber != null) { + queryParams.put("pageNumber", pageNumber.toString()); + } + if (pageSize != null) { + queryParams.put("pageSize", pageSize.toString()); + } + if (goal != null) { + queryParams.put("goal", goal.toString()); + } + + String requestBody = listNonprofitsRequest.toJson(); + Resource resource = + new Resource(this, this.baseURL + "/companies/{companyId}/nonprofits", null); + String jsonResult = + resource.request( + requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams, queryParams); + return ListNonprofitsResponse.fromJson(jsonResult); + } + + /** + * Update a donation campaign + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param donationCampaignId {@link String } The unique identifier of the donation campaign to be + * updated. (required) + * @param donationCampaignUpdate {@link DonationCampaignUpdate } (required) + * @return {@link DonationCampaign } + * @throws ApiException if fails to make API call + */ + public DonationCampaign updateDonationCampaign( + String companyId, String donationCampaignId, DonationCampaignUpdate donationCampaignUpdate) + throws ApiException, IOException { + return updateDonationCampaign(companyId, donationCampaignId, donationCampaignUpdate, null); + } + + /** + * Update a donation campaign + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param donationCampaignId {@link String } The unique identifier of the donation campaign to be + * updated. (required) + * @param donationCampaignUpdate {@link DonationCampaignUpdate } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link DonationCampaign } + * @throws ApiException if fails to make API call + */ + public DonationCampaign updateDonationCampaign( + String companyId, + String donationCampaignId, + DonationCampaignUpdate donationCampaignUpdate, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (companyId == null) { + throw new IllegalArgumentException("Please provide the companyId path parameter"); + } + pathParams.put("companyId", companyId); + if (donationCampaignId == null) { + throw new IllegalArgumentException("Please provide the donationCampaignId path parameter"); + } + pathParams.put("donationCampaignId", donationCampaignId); + + String requestBody = donationCampaignUpdate.toJson(); + Resource resource = + new Resource( + this, + this.baseURL + "/companies/{companyId}/campaignManagement/{donationCampaignId}", + null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return DonationCampaign.fromJson(jsonResult); + } + + /** + * Activate or end a donation campaign + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param donationCampaignId {@link String } The unique identifier of the donation campaign to + * activate or end. (required) + * @param status {@link CampaignStatusTransition } The desired status change. Possible values: + * **activate** or **end**. (required) + * @return {@link DonationCampaign } + * @throws ApiException if fails to make API call + */ + public DonationCampaign updateDonationCampaignStatus( + String companyId, String donationCampaignId, CampaignStatusTransition status) + throws ApiException, IOException { + return updateDonationCampaignStatus(companyId, donationCampaignId, status, null); + } + + /** + * Activate or end a donation campaign + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param donationCampaignId {@link String } The unique identifier of the donation campaign to + * activate or end. (required) + * @param status {@link CampaignStatusTransition } The desired status change. Possible values: + * **activate** or **end**. (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link DonationCampaign } + * @throws ApiException if fails to make API call + */ + public DonationCampaign updateDonationCampaignStatus( + String companyId, + String donationCampaignId, + CampaignStatusTransition status, + RequestOptions requestOptions) + throws ApiException, IOException { + // Add path params + Map pathParams = new HashMap<>(); + if (companyId == null) { + throw new IllegalArgumentException("Please provide the companyId path parameter"); + } + pathParams.put("companyId", companyId); + if (donationCampaignId == null) { + throw new IllegalArgumentException("Please provide the donationCampaignId path parameter"); + } + pathParams.put("donationCampaignId", donationCampaignId); + if (status == null) { + throw new IllegalArgumentException("Please provide the status path parameter"); + } + pathParams.put("status", status.toString()); + + String requestBody = null; + Resource resource = + new Resource( + this, + this.baseURL + + "/companies/{companyId}/campaignManagement/{donationCampaignId}/status/{status}", + null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return DonationCampaign.fromJson(jsonResult); + } +} From ee43ca45d976f87d84b90e1b068eccf2cc230d0b Mon Sep 17 00:00:00 2001 From: poojah Date: Tue, 21 Jul 2026 16:13:48 +0200 Subject: [PATCH 2/2] Add tests for [management] donation campaigns API --- src/test/java/com/adyen/ManagementTest.java | 124 ++++++++++++++++++ .../mocks/management/donation-campaign.json | 12 ++ 2 files changed, 136 insertions(+) create mode 100644 src/test/resources/mocks/management/donation-campaign.json diff --git a/src/test/java/com/adyen/ManagementTest.java b/src/test/java/com/adyen/ManagementTest.java index 5ac7bd199..d4cf6fc2c 100644 --- a/src/test/java/com/adyen/ManagementTest.java +++ b/src/test/java/com/adyen/ManagementTest.java @@ -159,6 +159,130 @@ public void removeAllowedOrigin() throws IOException, ApiException, HTTPClientEx null); } + // Breaking change: PaymentMethodSetupInfo.carnet type changed from GenericPmWithTdiInfo to + // CarnetInfo. Verifies the new type round-trips through serialization. + @Test + public void paymentMethodSetupInfoCarnetType() throws IOException { + PaymentMethodSetupInfo request = new PaymentMethodSetupInfo(); + request.setType(PaymentMethodSetupInfo.TypeEnum.CARNET); + request.setCarnet(new CarnetInfo().addMccAcronym(true)); + + String json = request.toJson(); + PaymentMethodSetupInfo parsed = PaymentMethodSetupInfo.fromJson(json); + + CarnetInfo carnet = parsed.getCarnet(); + assertNotNull(carnet); + assertTrue(carnet.getAddMccAcronym()); + } + + // Non-breaking: new DonationCampaignsApi service create endpoint. + @Test + public void createDonationCampaign() throws IOException, ApiException, HTTPClientException { + Client client = createMockClientFromFile("mocks/management/donation-campaign.json"); + DonationCampaignsApi service = new DonationCampaignsApi(client); + DonationCampaignRequest request = + new DonationCampaignRequest().name("Clean water campaign").nonprofitCauseId("CAUSE123"); + + DonationCampaign campaign = service.createDonationCampaign("YOUR_COMPANY_ID", request); + + assertEquals("DC123456789", campaign.getId()); + assertEquals("Clean water campaign", campaign.getName()); + assertEquals(DonationCampaignStatus.ACTIVE, campaign.getStatus()); + assertNotNull(campaign.getNonprofitCause()); + assertEquals("Water for All", campaign.getNonprofitCause().getNonprofitName()); + verify(client.getHttpClient()) + .request( + String.format( + "https://management-test.adyen.com/v%s/companies/YOUR_COMPANY_ID/campaignManagement", + DonationCampaignsApi.API_VERSION), + "{\"name\":\"Clean water campaign\",\"nonprofitCauseId\":\"CAUSE123\"}", + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + // Non-breaking: DonationCampaignsApi status transition; guards the enum path param that + // previously failed to compile (CampaignStatusTransition put into a String path map). + @Test + public void updateDonationCampaignStatus() throws IOException, ApiException, HTTPClientException { + Client client = createMockClientFromFile("mocks/management/donation-campaign.json"); + DonationCampaignsApi service = new DonationCampaignsApi(client); + + DonationCampaign campaign = + service.updateDonationCampaignStatus( + "YOUR_COMPANY_ID", "DC123456789", CampaignStatusTransition.ACTIVATE); + + assertEquals(DonationCampaignStatus.ACTIVE, campaign.getStatus()); + verify(client.getHttpClient()) + .request( + String.format( + "https://management-test.adyen.com/v%s/companies/YOUR_COMPANY_ID/campaignManagement/DC123456789/status/activate", + DonationCampaignsApi.API_VERSION), + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + // Non-breaking: new PaymentMethod.associatedPaymentMethods field deserializes. + @Test + public void paymentMethodAssociatedPaymentMethods() throws IOException { + String json = + "{\"type\":\"visa\",\"associatedPaymentMethods\":" + + "[{\"id\":\"PM123\",\"type\":\"cartebancaire\",\"enabled\":true}]}"; + + PaymentMethod parsed = PaymentMethod.fromJson(json); + + assertNotNull(parsed.getAssociatedPaymentMethods()); + assertEquals(1, parsed.getAssociatedPaymentMethods().size()); + AssociatedPaymentMethod associated = parsed.getAssociatedPaymentMethods().get(0); + assertEquals("PM123", associated.getId()); + assertEquals("cartebancaire", associated.getType()); + assertTrue(associated.getEnabled()); + } + + // Non-breaking: new Surcharge.disclosureOnPresentCard field round-trips. + @Test + public void surchargeDisclosureOnPresentCard() throws IOException { + Surcharge surcharge = new Surcharge().disclosureOnPresentCard(true); + + Surcharge parsed = Surcharge.fromJson(surcharge.toJson()); + + assertTrue(parsed.getDisclosureOnPresentCard()); + } + + // Non-breaking: new SplitConfigurationLogic.dcc field (SplitDcc) round-trips. + @Test + public void splitConfigurationLogicDcc() throws IOException { + SplitConfigurationLogic logic = + new SplitConfigurationLogic().dcc(new SplitDcc().accountHolderPercentage(50L)); + + SplitConfigurationLogic parsed = SplitConfigurationLogic.fromJson(logic.toJson()); + + assertNotNull(parsed.getDcc()); + assertEquals(Long.valueOf(50L), parsed.getDcc().getAccountHolderPercentage()); + } + + // Value rename: MealVoucherFRInfo.subTypes allowed value is mealVoucher_FR_endenred per the + // Management v3 spec. Verifies the documented value round-trips. + @Test + public void mealVoucherFRInfoSubTypes() throws IOException { + MealVoucherFRInfo info = + new MealVoucherFRInfo() + .conecsId("123456") + .siret("12345678901234") + .addSubTypesItem("mealVoucher_FR_endenred"); + + MealVoucherFRInfo parsed = MealVoucherFRInfo.fromJson(info.toJson()); + + assertNotNull(parsed.getSubTypes()); + assertEquals("mealVoucher_FR_endenred", parsed.getSubTypes().get(0)); + } + @Test @Disabled("Integration test") public void me() throws IOException, ApiException { diff --git a/src/test/resources/mocks/management/donation-campaign.json b/src/test/resources/mocks/management/donation-campaign.json new file mode 100644 index 000000000..18d0d59de --- /dev/null +++ b/src/test/resources/mocks/management/donation-campaign.json @@ -0,0 +1,12 @@ +{ + "id": "DC123456789", + "name": "Clean water campaign", + "status": "active", + "accountHolderIds": ["AH123", "AH456"], + "nonprofitCause": { + "causeId": "CAUSE123", + "nonprofitName": "Water for All", + "description": "Providing clean water access", + "goals": ["unsdg_6"] + } +}